----------------------------------------------------------------------------- -----------------------------------------------------------------------------
| 141 | // <TimerThread::TimerSetEvent> |
| 142 | //----------------------------------------------------------------------------- |
| 143 | TimerThread::TimerEventEntry* TimerThread::TimerSetEvent |
| 144 | ( |
| 145 | int32 _milliseconds, |
| 146 | TimerCallback _callback, |
| 147 | Timer *_instance, |
| 148 | uint32 id |
| 149 | ) |
| 150 | { |
| 151 | Log::Write( LogLevel_Info, "Timer: adding event in %d ms", _milliseconds ); |
| 152 | TimerEventEntry *te = new TimerEventEntry(); |
| 153 | te->timestamp.SetTime(_milliseconds); |
| 154 | te->callback = _callback; |
| 155 | te->instance = _instance; |
| 156 | te->id = id; |
| 157 | // Don't want driver thread and timer thread accessing list at the same time. |
| 158 | LockGuard LG(m_timerMutex); |
| 159 | m_timerEventList.push_back(te); |
| 160 | m_timerEvent->Set(); |
| 161 | return te; |
| 162 | } |
| 163 | |
| 164 | //----------------------------------------------------------------------------- |
| 165 | // <TimerThread::TimerDelEvent> |