MCPcopy Create free account
hub / github.com/caozhiyi/CppNet / _AddTimer

Method _AddTimer

net/Timer.cpp:114–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void 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
127void CTimer::_AddTimer(uint32_t interval, base::CMemSharePtr<CTimerEvent>& event) {
128 event->_interval = interval;

Callers

nothing calls this directly

Calls 2

NowMethod · 0.80
GetMsecMethod · 0.80

Tested by

no test coverage detected