returns : 0 - dialog was inserted in timer list with the new timeout 1 - dialog was inserted in timer list with the new timeout -1 - failure (dialog is expired, so it cannot be added again) */
| 550 | 1 - dialog was inserted in timer list with the new timeout |
| 551 | -1 - failure (dialog is expired, so it cannot be added again) */ |
| 552 | int update_dlg_timer( struct dlg_tl *tl, int timeout ) |
| 553 | { |
| 554 | int ret; |
| 555 | |
| 556 | lock_get( d_timer->lock); |
| 557 | |
| 558 | if ( tl->next == FAKE_DIALOG_TL ) { |
| 559 | /* previously removed from timer list - we will not add it again */ |
| 560 | lock_release( d_timer->lock); |
| 561 | return 0; |
| 562 | } |
| 563 | |
| 564 | if ( tl->next ) { |
| 565 | if (tl->prev==0) { |
| 566 | lock_release( d_timer->lock); |
| 567 | return -1; |
| 568 | } |
| 569 | remove_dlg_timer_unsafe(tl); |
| 570 | ret = 0; |
| 571 | } else { |
| 572 | ret = 1; |
| 573 | } |
| 574 | |
| 575 | tl->timeout = get_ticks()+timeout; |
| 576 | insert_gen_timer_unsafe( d_timer, tl ); |
| 577 | |
| 578 | lock_release( d_timer->lock); |
| 579 | return ret; |
| 580 | } |
| 581 | |
| 582 | static inline struct dlg_tl* _get_gen_expired_dlgs(struct dlg_timer *timer, unsigned int time) |
| 583 | { |
no test coverage detected