diff options
author | Nanang Izzuddin <nanang@teluu.com> | 2012-08-07 03:32:34 +0000 |
---|---|---|
committer | Nanang Izzuddin <nanang@teluu.com> | 2012-08-07 03:32:34 +0000 |
commit | 400e2678acf563c77287a64f2fef8143b3f57b41 (patch) | |
tree | d0df366a1e8d27a5804cbdb1f3e02d49ad2e2f95 /pjlib-util | |
parent | 5d74cbe644626579d0327faf4a3eaba8b9d2bd51 (diff) |
Fixed #1565: deadlock in DNS resolver.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4220 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib-util')
-rw-r--r-- | pjlib-util/src/pjlib-util/resolver.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pjlib-util/src/pjlib-util/resolver.c b/pjlib-util/src/pjlib-util/resolver.c index 81220bc9..b80fd2e5 100644 --- a/pjlib-util/src/pjlib-util/resolver.c +++ b/pjlib-util/src/pjlib-util/resolver.c @@ -1248,6 +1248,9 @@ static void on_timeout( pj_timer_heap_t *timer_heap, pj_hash_set(NULL, resolver->hquerybyid, &q->id, sizeof(q->id), 0, NULL); pj_hash_set(NULL, resolver->hquerybyres, &q->key, sizeof(q->key), 0, NULL); + /* Workaround for deadlock problem in #1565 (similar to #1108) */ + pj_mutex_unlock(resolver->mutex); + /* Call application callback, if any. */ if (q->cb) (*q->cb)(q->user_data, PJ_ETIMEDOUT, NULL); @@ -1260,6 +1263,9 @@ static void on_timeout( pj_timer_heap_t *timer_heap, cq = cq->next; } + /* Workaround for deadlock problem in #1565 (similar to #1108) */ + pj_mutex_lock(resolver->mutex); + /* Clear data */ q->timer_entry.id = 0; q->user_data = NULL; |