Changeset 4449 for pjproject/trunk
- Timestamp:
- Mar 22, 2013 3:16:35 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/timer.c
r4359 r4449 46 46 #define DEFAULT_MAX_TIMED_OUT_PER_POLL (64) 47 47 48 enum 49 { 50 F_DONT_CALL = 1, 51 F_DONT_ASSERT = 2, 52 F_SET_ID = 4 53 }; 54 48 55 49 56 /** … … 314 321 static int cancel( pj_timer_heap_t *ht, 315 322 pj_timer_entry *entry, 316 int dont_call)323 unsigned flags) 317 324 { 318 325 long timer_node_slot; … … 331 338 if (entry != ht->heap[timer_node_slot]) 332 339 { 333 pj_assert(entry == ht->heap[timer_node_slot]); 340 if ((flags & F_DONT_ASSERT) == 0) 341 pj_assert(entry == ht->heap[timer_node_slot]); 334 342 return 0; 335 343 } … … 338 346 remove_node( ht, timer_node_slot); 339 347 340 if ( dont_call== 0)348 if ((flags & F_DONT_CALL) == 0) 341 349 // Call the close hook. 342 350 (*ht->callback)(ht, entry); … … 552 560 static int cancel_timer(pj_timer_heap_t *ht, 553 561 pj_timer_entry *entry, 554 pj_bool_t set_id,562 unsigned flags, 555 563 int id_val) 556 564 { … … 560 568 561 569 lock_timer_heap(ht); 562 count = cancel(ht, entry, 1);563 if ( set_id) {570 count = cancel(ht, entry, flags | F_DONT_CALL); 571 if (flags & F_SET_ID) { 564 572 entry->id = id_val; 565 573 } … … 577 585 pj_timer_entry *entry) 578 586 { 579 return cancel_timer(ht, entry, PJ_FALSE, 0);587 return cancel_timer(ht, entry, 0, 0); 580 588 } 581 589 … … 584 592 int id_val) 585 593 { 586 return cancel_timer(ht, entry, PJ_TRUE, id_val);594 return cancel_timer(ht, entry, F_SET_ID | F_DONT_ASSERT, id_val); 587 595 } 588 596
Note: See TracChangeset
for help on using the changeset viewer.