Dispatcher interface and implementations.
Classes | |
| class | pw::async2::BasicDispatcher |
| class | pw::async2::Dispatcher |
| class | pw::async2::RunnableDispatcher |
Functions | |
| void | pw::async2::BasicDispatcher::DoWake () override |
| void | pw::async2::BasicDispatcher::DoWaitForWake () override |
| bool | pw::async2::RunnableDispatcher::RunUntilStalled () |
| void | pw::async2::RunnableDispatcher::RunToCompletion () |
| void | pw::async2::RunnableDispatcher::RunForever () |
| virtual void | pw::async2::RunnableDispatcher::DoWaitForWake ()=0 |
Friends | |
| template<typename > | |
| class | pw::async2::RunnableDispatcher::DispatcherForTestFacade |
|
inlineoverrideprivatevirtual |
Blocks until DoWake() is called. Must return immediately if DoWake() was already called since the last DoWaitForWake call.
If the implementation is unable to block the thread, it must crash.
Implements pw::async2::RunnableDispatcher.
|
privatepure virtual |
Blocks until DoWake() is called. Must return immediately if DoWake() was already called since the last DoWaitForWake call.
If the implementation is unable to block the thread, it must crash.
Implemented in pw::async2::BasicDispatcher, and pw::async2::DispatcherForTestFacade< Native >.
|
inlineoverrideprivatevirtual |
Sends a wakeup signal to this Dispatcher.
This method's implementation must ensure that the Dispatcher runs at some point in the future.
DoWake() will only be called once until one of the following occurs:
PopAndRunAllReadyTasks() is called,PopTaskToRun() returns nullptr, orPopSingleTaskForThisWake() is called.impl::dispatcher_lock() may or may not be held here, so it must not be acquired by DoWake, nor may DoWake assume that it has been acquired. Implements pw::async2::Dispatcher.
| void pw::async2::RunnableDispatcher::RunForever | ( | ) |
Runs the dispatcher on this thread indefinitely, sleeping when there is no work to perform.
| void pw::async2::RunnableDispatcher::RunToCompletion | ( | ) |
Runs tasks on the dispatcher until all tasks are completed, blocking the thread as needed.
RunToCompletion returns when there are no tasks on the dispatcher, but new tasks could be posted to RunToCompletion from another thread before the function even returns.
|
inline |
Runs tasks until no further progress can be made.
| true | There are still sleeping tasks in the dispatcher. |
| false | All tasks ran to completion. |