C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::BasicDispatcher Class Referencefinal

Overview

Simple RunnableDispatcher implementation that uses a pw::sync::ThreadNotification to wait for tasks to wake.

Inheritance diagram for pw::async2::BasicDispatcher:
pw::async2::RunnableDispatcher pw::async2::Dispatcher

Private Member Functions

void DoWake () override
 
void DoWaitForWake () override
 

Additional Inherited Members

- Public Member Functions inherited from pw::async2::RunnableDispatcher
bool RunUntilStalled ()
 
void RunToCompletion ()
 
void RunForever ()
 
- Public Member Functions inherited from pw::async2::Dispatcher
 Dispatcher (Dispatcher &)=delete
 
Dispatcheroperator= (Dispatcher &)=delete
 
 Dispatcher (Dispatcher &&)=delete
 
Dispatcheroperator= (Dispatcher &&)=delete
 
void Post (Task &task)
 
void LogRegisteredTasks ()
 
- Protected Types inherited from pw::async2::Dispatcher
enum  RunTaskResult { kActive = Task::kActive , kDeregistered = Task::kDeregistered , kCompleted = Task::kCompleted }
 
- Protected Member Functions inherited from pw::async2::Dispatcher
bool PopAndRunAllReadyTasks ()
 
TaskPopTaskToRun ()
 
TaskPopTaskToRun (bool &has_posted_tasks)
 
TaskPopSingleTaskForThisWake ()
 
RunTaskResult RunTask (Task &task)
 

Member Function Documentation

◆ DoWaitForWake()

void pw::async2::BasicDispatcher::DoWaitForWake ( )
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.

◆ DoWake()

void pw::async2::BasicDispatcher::DoWake ( )
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:

Note
The internal::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.


The documentation for this class was generated from the following file: