From 41bb8bd542d37fc6fcce6c908ad11528a1c1db65 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Sun, 26 Feb 2006 21:20:52 +0000 Subject: 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 --- pjlib/src/pj/os_core_win32.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'pjlib/src/pj/os_core_win32.c') diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c index 94c438fe..a7aee215 100644 --- a/pjlib/src/pj/os_core_win32.c +++ b/pjlib/src/pj/os_core_win32.c @@ -202,8 +202,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) { - *thread_ptr = (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. */ -- cgit v1.2.3