summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2012-10-08 08:13:12 +0000
committerLiong Sauw Ming <ming@teluu.com>2012-10-08 08:13:12 +0000
commitf28535801e44e27aeb820b5214a836c2fdf45a6f (patch)
tree29b5cd25542dfdb74cd01adf86877ee83bf2ffc1 /pjlib
parent05121265a65a3e65e4d9c476035b1897d2d79005 (diff)
Fixed #1592: Multithreading issues in PJSIP (fixing pj_timer_heap_poll() and lock order inversion in tcp/tls transport)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4281 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/src/pj/timer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c
index ad037068..767a261f 100644
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -512,15 +512,16 @@ PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht,
PJ_ASSERT_RETURN(ht, 0);
+ lock_timer_heap(ht);
if (!ht->cur_size && next_delay) {
next_delay->sec = next_delay->msec = PJ_MAXINT32;
+ unlock_timer_heap(ht);
return 0;
}
count = 0;
pj_gettickcount(&now);
- lock_timer_heap(ht);
while ( ht->cur_size &&
PJ_TIME_VAL_LTE(ht->heap[0]->_timer_value, now) &&
count < ht->max_entries_per_poll )