From 7670782f12da1065083caa6b216a2017ad87aa33 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Tue, 25 Oct 2011 12:14:12 +0000 Subject: Re #1394: Ignore thread join if called from the same thread, it will cause the thread blocks forever. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3855 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/os_core_win32.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pjlib') diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c index 866afb99..30992a4f 100644 --- a/pjlib/src/pj/os_core_win32.c +++ b/pjlib/src/pj/os_core_win32.c @@ -559,6 +559,9 @@ PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *p) PJ_CHECK_STACK(); PJ_ASSERT_RETURN(p, PJ_EINVAL); + if (p == pj_thread_this()) + return PJ_ECANCELLED; + PJ_LOG(6, (pj_thread_this()->obj_name, "Joining thread %s", p->obj_name)); rc = WaitForSingleObject(rec->hthread, INFINITE); -- cgit v1.2.3