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

Method run

lib_acl_cpp/include/acl_cpp/stdlib/trigger.hpp:265–292  ·  view source on GitHub ↗

@override

Source from the content-addressed store, hash-verified

263private:
264 // @override
265 void* run() {
266 while (!stop_) {
267 T* o = mbox_.pop(delay_);
268 if (o) {
269 timer_.add(o);
270 }
271
272 long long next = timer_.trigger();
273 long long curr = get_curr_stamp();
274 if (next == -1) {
275 delay_ = 100;
276 } else {
277 delay_ = next - curr;
278 if (delay_ < 0) {
279 delay_ = 1;
280 }
281 }
282
283 lock_.lock();
284 typename std::vector<T*>::iterator it;
285 for (it = timer_del_.begin(); it != timer_del_.end(); ++it) {
286 timer_.del(*it);
287 }
288 timer_del_.clear();
289 lock_.unlock();
290 }
291 return NULL;
292 }
293
294private:
295 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