MCPcopy Create free account
hub / github.com/Amanieu/asyncplusplus / generic_wait_handler

Function generic_wait_handler

src/scheduler.cpp:57–71  ·  view source on GitHub ↗

Wait for a task to complete (for threads outside thread pool)

Source from the content-addressed store, hash-verified

55
56// Wait for a task to complete (for threads outside thread pool)
57static void generic_wait_handler(task_wait_handle wait_task)
58{
59 // Create an event to wait on
60 task_wait_event event;
61 event.init();
62
63 // Create a continuation for the task we are waiting for
64 wait_task.on_finish([&event] {
65 // Just signal the thread event
66 event.signal(wait_type::task_finished);
67 });
68
69 // Wait for the event to be set
70 event.wait();
71}
72
73#if defined(EMULATE_PTHREAD_THREAD_LOCAL)
74// Wait handler function, per-thread, defaults to generic version

Callers

nothing calls this directly

Calls 4

initMethod · 0.80
on_finishMethod · 0.80
signalMethod · 0.80
waitMethod · 0.45

Tested by

no test coverage detected