diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-02-26 21:20:52 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-02-26 21:20:52 +0000 |
commit | 41bb8bd542d37fc6fcce6c908ad11528a1c1db65 (patch) | |
tree | bc7b7f0081c6aa522282fed2a6fbefb223b11d81 /pjlib/src/pj/os_core_unix.c | |
parent | 47c1f09504fce4a8f980e8a407f40dbfaacc5a6b (diff) |
Fixed bug pj_thread_register() when same thread is re-registered with different descriptor
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@233 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_core_unix.c')
-rw-r--r-- | pjlib/src/pj/os_core_unix.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c index 03713e9a..72e22ef1 100644 --- a/pjlib/src/pj/os_core_unix.c +++ b/pjlib/src/pj/os_core_unix.c @@ -189,8 +189,13 @@ PJ_DEF(pj_status_t) pj_thread_register ( const char *cstr_thread_name, /* If a thread descriptor has been registered before, just return it. */ if (pj_thread_local_get (thread_tls_id) != 0) { - *ptr_thread = (pj_thread_t*)pj_thread_local_get (thread_tls_id); - return PJ_SUCCESS; + // 2006-02-26 bennylp: + // This wouldn't work in all cases!. + // If thread is created by external module (e.g. sound thread), + // thread may be reused while the pool used for the thread descriptor + // has been deleted by application. + //*thread_ptr = (pj_thread_t*)pj_thread_local_get (thread_tls_id); + //return PJ_SUCCESS; } /* Initialize and set the thread entry. */ |