MCPcopy Create free account
hub / github.com/acl-dev/acl / run

Method run

lib_acl_cpp/include/acl_cpp.cn/stdlib/trigger.hpp:255–282  ·  view source on GitHub ↗

@override

Source from the content-addressed store, hash-verified

253private:
254 // @override
255 void* run() {
256 while (!stop_) {
257 T* o = mbox_.pop(delay_);
258 if (o) {
259 timer_.add(o);
260 }
261
262 long long next = timer_.trigger();
263 long long curr = get_curr_stamp();
264 if (next == -1) {
265 delay_ = 100;
266 } else {
267 delay_ = next - curr;
268 if (delay_ < 0) {
269 delay_ = 1;
270 }
271 }
272
273 lock_.lock();
274 typename std::vector<T*>::iterator it;
275 for (it = timer_del_.begin(); it != timer_del_.end(); ++it) {
276 timer_.del(*it);
277 }
278 timer_del_.clear();
279 lock_.unlock();
280 }
281 return NULL;
282 }
283
284private:
285 long long delay_;

Callers

nothing calls this directly

Calls 10

get_curr_stampFunction · 0.85
beginMethod · 0.80
popMethod · 0.45
addMethod · 0.45
triggerMethod · 0.45
lockMethod · 0.45
endMethod · 0.45
delMethod · 0.45
clearMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected