summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-02-26 21:20:52 +0000
committerBenny Prijono <bennylp@teluu.com>2006-02-26 21:20:52 +0000
commit41bb8bd542d37fc6fcce6c908ad11528a1c1db65 (patch)
treebc7b7f0081c6aa522282fed2a6fbefb223b11d81
parent47c1f09504fce4a8f980e8a407f40dbfaacc5a6b (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
-rw-r--r--pjlib/src/pj/config.c2
-rw-r--r--pjlib/src/pj/os_core_linux_kernel.c9
-rw-r--r--pjlib/src/pj/os_core_unix.c9
-rw-r--r--pjlib/src/pj/os_core_win32.c9
4 files changed, 22 insertions, 7 deletions
diff --git a/pjlib/src/pj/config.c b/pjlib/src/pj/config.c
index bc9015f4..385baad7 100644
--- a/pjlib/src/pj/config.c
+++ b/pjlib/src/pj/config.c
@@ -21,7 +21,7 @@
#include <pj/ioqueue.h>
static const char *id = "config.c";
-const char *PJ_VERSION = "0.5.1.3";
+const char *PJ_VERSION = "0.5.2";
PJ_DEF(void) pj_dump_config(void)
{
diff --git a/pjlib/src/pj/os_core_linux_kernel.c b/pjlib/src/pj/os_core_linux_kernel.c
index b91e4e0f..b85e9ba1 100644
--- a/pjlib/src/pj/os_core_linux_kernel.c
+++ b/pjlib/src/pj/os_core_linux_kernel.c
@@ -251,8 +251,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. */
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. */
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. */