From 3cecf5e67b1d0768a1eb63d2fa52dd3c992339ac Mon Sep 17 00:00:00 2001 From: Liong Sauw Ming Date: Wed, 27 Feb 2013 12:02:42 +0000 Subject: Re #1592: Backported to 1.x git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@4394 74dad513-b988-da41-8d7b-12977e46ad98 --- pjlib/src/pj/timer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pjlib/src/pj/timer.c') 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 ) -- cgit v1.2.3