summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2013-02-27 12:02:42 +0000
committerLiong Sauw Ming <ming@teluu.com>2013-02-27 12:02:42 +0000
commit3cecf5e67b1d0768a1eb63d2fa52dd3c992339ac (patch)
treeec30d9373925716169bdcfe3caafb597e992ab12 /pjlib
parent9127fefa3c8c22ef443c9d1fdfe9449b328bffd5 (diff)
Re #1592: Backported to 1.x
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4394 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 573c7ecb..a652d11e 100644
--- a/pjlib/src/pj/timer.c
+++ b/pjlib/src/pj/timer.c
@@ -497,15 +497,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 )