Changeset 2984 for pjproject/trunk
- Timestamp:
- Nov 4, 2009 4:24:33 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/timer_symbian.cpp
r2394 r2984 29 29 #define DEFAULT_MAX_TIMED_OUT_PER_POLL (64) 30 30 31 // Maximum number of miliseconds that RTimer.At() supports 32 #define MAX_RTIMER_INTERVAL 2147 33 31 34 32 35 /** … … 66 69 pj_timer_entry *entry_; 67 70 RTimer rtimer_; 71 pj_uint32_t interval_left_; 68 72 69 73 CPjTimerEntry(pj_timer_heap_t *timer_heap, pj_timer_entry *entry); 70 74 void ConstructL(const pj_time_val *delay); 75 void Schedule(); 71 76 }; 72 77 … … 74 79 CPjTimerEntry::CPjTimerEntry(pj_timer_heap_t *timer_heap, 75 80 pj_timer_entry *entry) 76 : CActive(PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_(timer_heap), entry_(entry) 81 : CActive(PJ_SYMBIAN_TIMER_PRIORITY), timer_heap_(timer_heap), entry_(entry), 82 interval_left_(0) 77 83 { 78 84 } … … 84 90 } 85 91 92 void CPjTimerEntry::Schedule() 93 { 94 pj_int32_t interval; 95 96 if (interval_left_ > MAX_RTIMER_INTERVAL) { 97 interval = MAX_RTIMER_INTERVAL; 98 } else { 99 interval = interval_left_; 100 } 101 102 interval_left_ -= interval; 103 rtimer_.After(iStatus, interval * 1000); 104 SetActive(); 105 } 106 86 107 void CPjTimerEntry::ConstructL(const pj_time_val *delay) 87 108 { … … 89 110 CActiveScheduler::Add(this); 90 111 91 pj_int32_t interval = PJ_TIME_VAL_MSEC(*delay) * 1000; 92 if (interval < 0) { 93 interval = 0; 94 } 95 rtimer_.After(iStatus, interval); 96 SetActive(); 112 interval_left_ = PJ_TIME_VAL_MSEC(*delay); 113 Schedule(); 97 114 } 98 115 … … 111 128 void CPjTimerEntry::RunL() 112 129 { 130 if (interval_left_ > 0) { 131 Schedule(); 132 return; 133 } 134 113 135 --timer_heap_->cur_size; 114 136 entry_->_timer_id = NULL;
Note: See TracChangeset
for help on using the changeset viewer.