diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-03-04 14:45:19 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-03-04 14:45:19 +0000 |
commit | 5254d7c3a14177dffdf43c3ec7e5235b066d986e (patch) | |
tree | 249ea16a1ab2e6d7693c56af6d9af5516590b589 /pjlib/include/pj | |
parent | 771571a57c706e924ba3511dbf6c6e3dbda93c68 (diff) |
Ticket #500: Added function to set thread priority in PJLIB
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1841 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include/pj')
-rw-r--r-- | pjlib/include/pj/os.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h index a5c10df8..f5503c98 100644 --- a/pjlib/include/pj/os.h +++ b/pjlib/include/pj/os.h @@ -138,6 +138,46 @@ PJ_DECL(pj_bool_t) pj_thread_is_registered(void); /** + * Get thread priority value for the thread. + * + * @param thread Thread handle. + * + * @return Thread priority value, or -1 on error. + */ +PJ_DECL(int) pj_thread_get_prio(pj_thread_t *thread); + + +/** + * Set the thread priority. The priority value must be in the priority + * value range, which can be retrieved with #pj_thread_get_prio_min() and + * #pj_thread_get_prio_max() functions. + * + * @param thread Thread handle. + * @param prio New priority to be set to the thread. + * + * @return PJ_SUCCESS on success or the error code. + */ +PJ_DECL(pj_status_t) pj_thread_set_prio(pj_thread_t *thread, int prio); + +/** + * Get the lowest priority value available for this thread. + * + * @param thread Thread handle. + * @return Minimum thread priority value, or -1 on error. + */ +PJ_DECL(int) pj_thread_get_prio_min(pj_thread_t *thread); + + +/** + * Get the highest priority value available for this thread. + * + * @param thread Thread handle. + * @return Minimum thread priority value, or -1 on error. + */ +PJ_DECL(int) pj_thread_get_prio_max(pj_thread_t *thread); + + +/** * Return native handle from pj_thread_t for manipulation using native * OS APIs. * |