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

Method Wait

executor/lib/graph_task.cpp:372–400  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370}
371
372int GraphTask::Wait(exec_event_t& event, int try_wait)
373{
374 WaitEvent* p_event = any_cast<WaitEvent*>(event);
375
376 if(p_event != &wait_event_)
377 {
378 XLOG_ERROR() << "bad event pointer passed\n";
379 return 0;
380 }
381
382 std::unique_lock<std::mutex> lock(p_event->mutex);
383
384 if(try_wait && !task_done_)
385 {
386 lock.unlock();
387 return 0;
388 }
389
390 p_event->wait_count++;
391
392 if(!task_done_)
393 p_event->cond.wait(lock, [this] { return task_done_; });
394
395 lock.unlock();
396
397 p_event->wait_count.fetch_sub(1);
398
399 return 1;
400}
401
402void GraphTask::SignalGraphTaskDone(void)
403{

Callers 2

WaitGraphMethod · 0.45
RunMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected