Changeset 4567
- Timestamp:
- Jul 19, 2013 6:31:28 AM (11 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/timer.h
r4359 r4567 212 212 void *user_data, 213 213 pj_timer_heap_callback *cb ); 214 215 /** 216 * Queries whether a timer entry is currently running. 217 * 218 * @param entry The timer entry to query. 219 * 220 * @return PJ_TRUE if the timer is running. PJ_FALSE if not. 221 */ 222 PJ_DECL(pj_bool_t) pj_timer_entry_running( pj_timer_entry *entry ); 214 223 215 224 /** -
pjproject/trunk/pjlib/src/pj/timer.c
r4537 r4567 467 467 } 468 468 469 PJ_DEF(pj_bool_t) pj_timer_entry_running( pj_timer_entry *entry ) 470 { 471 return (entry->_timer_id >= 1); 472 } 473 469 474 #if PJ_TIMER_DEBUG 470 475 static pj_status_t schedule_w_grp_lock_dbg(pj_timer_heap_t *ht, -
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r4537 r4567 2225 2225 pj_status_t status; 2226 2226 2227 if (resched && pj_timer_entry_running(&tsx->retransmit_timer)) { 2228 /* We've been asked to reschedule but the timer is already rerunning. 2229 * This can only happen in a race condition where, between removing 2230 * this retransmit timer from the heap and actually scheduling it, 2231 * another thread has got in and rescheduled the timer itself. In 2232 * this scenario, the transmission has already happened and so we 2233 * should just quit out immediately, without either resending the 2234 * message or restarting the timer. 2235 */ 2236 return PJ_SUCCESS; 2237 } 2238 2227 2239 PJ_ASSERT_RETURN(tsx->last_tx!=NULL, PJ_EBUG); 2228 2240 … … 2333 2345 */ 2334 2346 lock_timer(tsx); 2347 tsx_cancel_timer( tsx, &tsx->timeout_timer ); 2335 2348 tsx_schedule_timer( tsx, &tsx->timeout_timer, &timeout_timer_val, 2336 2349 TIMEOUT_TIMER); … … 2678 2691 2679 2692 lock_timer(tsx); 2693 tsx_cancel_timer(tsx, &tsx->timeout_timer); 2680 2694 tsx_schedule_timer( tsx, &tsx->timeout_timer, 2681 2695 &timeout, TIMEOUT_TIMER); … … 2706 2720 */ 2707 2721 lock_timer(tsx); 2722 tsx_cancel_timer(tsx, &tsx->timeout_timer); 2708 2723 if (tsx->method.id == PJSIP_INVITE_METHOD) { 2709 2724 /* Start timer H for INVITE */
Note: See TracChangeset
for help on using the changeset viewer.