diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-08-11 19:25:17 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-08-11 19:25:17 +0000 |
commit | 7da238dc72999218826690a46fe6538470ecde1e (patch) | |
tree | bc92dbab9041993441fd8f2e15e80b941b424f61 | |
parent | 925c039b2866b794ca279630f3de50326052c829 (diff) |
Added pj_thread_is_registered
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@674 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjlib/include/pj/os.h | 8 | ||||
-rw-r--r-- | pjlib/src/pj/os_core_unix.c | 9 | ||||
-rw-r--r-- | pjlib/src/pj/os_core_win32.c | 8 |
3 files changed, 25 insertions, 0 deletions
diff --git a/pjlib/include/pj/os.h b/pjlib/include/pj/os.h index ad2b49b1..2720e7f7 100644 --- a/pjlib/include/pj/os.h +++ b/pjlib/include/pj/os.h @@ -130,6 +130,14 @@ PJ_DECL(pj_status_t) pj_thread_register ( const char *thread_name, pj_thread_t **thread); /** + * Check if this thread has been registered to PJLIB. + * + * @return Non-zero if it is registered. + */ +PJ_DECL(pj_status_t) pj_thread_is_registered(void); + + +/** * Get thread name. * * @param thread The thread handle. diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c index 5fd630c1..0dba048e 100644 --- a/pjlib/src/pj/os_core_unix.c +++ b/pjlib/src/pj/os_core_unix.c @@ -179,6 +179,15 @@ PJ_DEF(pj_uint32_t) pj_getpid(void) } /* + * Check if this thread has been registered to PJLIB. + */ +PJ_DEF(pj_status_t) pj_thread_is_registered(void) +{ + return pj_thread_local_get(thread_tls_id) != 0; +} + + +/* * pj_thread_register(..) */ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c index 565efb3c..8ab04add 100644 --- a/pjlib/src/pj/os_core_win32.c +++ b/pjlib/src/pj/os_core_win32.c @@ -186,6 +186,14 @@ PJ_DEF(pj_uint32_t) pj_getpid(void) } /* + * Check if this thread has been registered to PJLIB. + */ +PJ_DEF(pj_status_t) pj_thread_is_registered(void) +{ + return pj_thread_local_get(thread_tls_id) != 0; +} + +/* * pj_thread_register(..) */ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, |