summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pjlib-util/src/pjlib-util/resolver.c6
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 ee0b9e78..6da22c50 100644
--- a/pjlib-util/src/pjlib-util/resolver.c
+++ b/pjlib-util/src/pjlib-util/resolver.c
@@ -1364,6 +1364,9 @@ static void on_read_complete(pj_ioqueue_key_t *key,
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 #1108 */
+ pj_mutex_unlock(resolver->mutex);
+
/* Notify applications first, to allow application to modify the
* record before it is saved to the hash table.
*/
@@ -1382,6 +1385,9 @@ static void on_read_complete(pj_ioqueue_key_t *key,
}
}
+ /* Workaround for deadlock problem in #1108 */
+ pj_mutex_lock(resolver->mutex);
+
/* Save/update response cache. */
update_res_cache(resolver, &q->key, status, PJ_TRUE, dns_pkt);