MCPcopy Create free account
hub / github.com/OAID/Tengine / ProcessAllEvents

Method ProcessAllEvents

core/lib/notify_instance.cpp:397–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

395}
396
397int NotifyBus::ProcessAllEvents(void)
398{
399 batch_count_ = 0;
400
401 /* first, move Node from pending queue to active queue */
402 pending_queue_mutex.lock();
403
404 while(!pending_queue.empty())
405 {
406 EventNode* node = pending_queue.front();
407 active_queue.push(node);
408 pending_queue.pop();
409 }
410
411 pending_queue_mutex.unlock();
412
413 while(!active_queue.empty())
414 {
415 EventNode* node = active_queue.front();
416
417 active_queue.pop();
418
419 if(!GetNode(node))
420 continue;
421
422 HandlePendingEvent(node);
423
424 if(node->event_tree.size())
425 {
426 active_queue.push(node);
427 }
428 else
429 {
430 node->active = false;
431 }
432
433 PutNode(node);
434
435 if(batch_count_ >= batch_budget_)
436 break;
437 }
438
439 return batch_count_;
440}
441
442void NotifyBus::SetBatchNum(int budget)
443{

Callers 2

test_singleFunction · 0.80
test_threadsFunction · 0.80

Calls 2

emptyMethod · 0.80
sizeMethod · 0.45

Tested by 2

test_singleFunction · 0.64
test_threadsFunction · 0.64