diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-10-28 05:07:22 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-10-28 05:07:22 +0000 |
commit | 53d3c1c881b1fa71211f5004ef78a925e8451e50 (patch) | |
tree | 0a19913b2f7eb0920f4e19abf4776ac9db3bb141 | |
parent | f42ef66bfab38c78211c944a8c32d2eaa2234f53 (diff) |
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
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_core.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); + } } } |