class SynchronizedDispatcher
Defined at line 205 of file ../../sdk/lib/driver/runtime/include/lib/fdf/cpp/dispatcher.h
Dispatcher that disallows parallel calls into callbacks.
Public Methods
zx::result<SynchronizedDispatcher> Create (Optionsoptions,std::string_viewname,ShutdownHandlershutdown_handler,std::string_viewscheduler_role)
Creates a dispatcher for performing asynchronous operations.
|options| provides the dispatcher configuration. This will panic if options does not
set FDF_DISPATCHER_OPTION_SYNCHRONIZED.
|name| is reported via diagnostics. It is similar to setting the name of a thread. Names longer
than `ZX_MAX_NAME_LEN` may be truncated.
|scheduler_role| is a hint. It may or not impact the priority the work scheduler against the
dispatcher is handled at. It may or may not impact the ability for other drivers to share
zircon threads with the dispatcher.
|shutdown_handler| will be called after |ShutdownAsync| has been called, and the dispatcher
has completed its asynchronous shutdown. The client must keep any pointers that are
referenced in |shutdown_handler| alive until the handler runs.
# Thread requirements
This must be called from a thread managed by the driver runtime.
# Errors
ZX_ERR_NOT_SUPPORTED: |options| is not a supported configuration, which is any of the
following:
* `FDF_DISPATCHER_OPTION_UNSYNCHRONIZED` with `FDF_DISPATCHER_OPTION_ALLOW_SYNC_CALLS`.
ZX_ERR_INVALID_ARGS: This was not called from a thread managed by the driver runtime.
ZX_ERR_NO_RESOURCES: A thread needed to be spawned to create this dispatcher, but couldn't be.
This is likely because a dispatcher that allows sync calls was requested, but the thread pool
is currently at its limit.
ZX_ERR_BAD_STATE: Dispatchers are currently not allowed to be created, such as when a driver
is being shutdown by its driver host.
Defined at line 253 of file ../../sdk/lib/driver/runtime/include/lib/fdf/cpp/dispatcher.h
void SynchronizedDispatcher (fdf_dispatcher_t * dispatcher)
Defined at line 279 of file ../../sdk/lib/driver/runtime/include/lib/fdf/cpp/dispatcher.h
Unowned<SynchronizedDispatcher> borrow ()
Defined at line 286 of file ../../sdk/lib/driver/runtime/include/lib/fdf/cpp/dispatcher.h