From 53d3c1c881b1fa71211f5004ef78a925e8451e50 Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Fri, 28 Oct 2011 05:07:22 +0000 Subject: Fixed #1407: Deadlock in initial resolution of STUN server git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3873 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsua-lib/pjsua_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'pjsip') diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index 9b7c4a16..d292122a 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -1263,8 +1263,12 @@ pj_status_t resolve_stun_server(pj_bool_t wait) * result. */ if (wait) { - while (pjsua_var.stun_status == PJ_EPENDING) - pjsua_handle_events(10); + while (pjsua_var.stun_status == PJ_EPENDING) { + if (pjsua_var.thread[0] == NULL) + pjsua_handle_events(10); + else + pj_thread_sleep(10); + } } } -- cgit v1.2.3