| 112 | } |
| 113 | |
| 114 | void CTimer::_AddTimer(uint32_t interval, const base::CMemSharePtr<CTimerEvent>& t, uint64_t& id) { |
| 115 | _time.Now(); |
| 116 | uint64_t nowtime = _time.GetMsec(); |
| 117 | uint64_t key = nowtime + interval; |
| 118 | |
| 119 | std::unique_lock<std::recursive_mutex> lock(_mutex); |
| 120 | while (_timer_map.count(key)) { |
| 121 | key++; |
| 122 | } |
| 123 | _timer_map[key] = t; |
| 124 | id = key; |
| 125 | } |
| 126 | |
| 127 | void CTimer::_AddTimer(uint32_t interval, base::CMemSharePtr<CTimerEvent>& event) { |
| 128 | event->_interval = interval; |