class DispatcherCoordinator
Defined at line 917 of file ../../src/devices/bin/driver_runtime/dispatcher.h
Coordinator for all dispatchers in a process.
Public Methods
void DispatcherCoordinator ()
We default to no threads, and start additional threads when blocking dispatchers are created.
Defined at line 920 of file ../../src/devices/bin/driver_runtime/dispatcher.h
bool AreAllDriversDestroyedLocked ()
Defined at line 964 of file ../../src/devices/bin/driver_runtime/dispatcher.h
Dispatcher::ThreadPool * default_thread_pool ()
Defined at line 982 of file ../../src/devices/bin/driver_runtime/dispatcher.h
Dispatcher::ThreadPool * GetOrCreateUnmanagedThreadPool ()
Returns the unmanaged thread pool. Creates it first if it doesn't exist.
Defined at line 985 of file ../../src/devices/bin/driver_runtime/dispatcher.h
void DestroyAllDispatchers ()
static
Defined at line 1663 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void WaitUntilDispatchersIdle ()
static
Defined at line 1554 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void WaitUntilDispatchersDestroyed ()
static
Defined at line 1568 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t TestingRun (zx::time deadline, bool once)
static
Defined at line 1578 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t TestingRunUntilIdle ()
static
Defined at line 1589 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void TestingQuit ()
static
Defined at line 1600 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t TestingResetQuit ()
static
Defined at line 1609 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t ShutdownDispatchersAsync (const void * driver, fdf_env_driver_shutdown_observer_t * observer)
static
Defined at line 1620 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t TokenRegister (zx_handle_ttoken,fdf_dispatcher_t *dispatcher,fdf_token_t *handler)
Implementation of fdf_token_*.
Defined at line 1686 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t TokenReceive (zx_handle_t token, fdf_handle_t * handle)
static
Defined at line 1693 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t TokenTransfer (zx_handle_t token, fdf_handle_t channel)
static
Defined at line 1699 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
uint32_t GetThreadLimit (std::string_view scheduler_role)
Implementation of fdf_env_*.
Defined at line 1805 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t SetThreadLimit (std::string_view scheduler_role, uint32_t max_threads)
static
Defined at line 1821 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
uint32_t GetSchedulerRoleOpts (std::string_view scheduler_role)
static
Defined at line 1838 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t SetSchedulerRoleOpts (std::string_view scheduler_role, uint32_t opts)
static
Defined at line 1854 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_duration_mono_t ScanThreadsForStalls ()
Defined at line 1870 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void RegisterStallScanner (fdf_env_stall_scanner_t * stall_scanner)
Defined at line 1888 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void TriggerStallScanner ()
Defined at line 1892 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t AddDispatcher (fbl::RefPtr<Dispatcher>dispatcher,std::string_viewscheduler_role,std::unique_ptr<Dispatcher::EventWaiter>event_waiter)
Returns ZX_OK if |dispatcher| was added successfully.
Returns ZX_ERR_BAD_STATE if the driver is currently shutting down.
Defined at line 1704 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t AddUnmanagedDispatcher (fbl::RefPtr<Dispatcher> dispatcher, std::unique_ptr<Dispatcher::EventWaiter> event_waiter)
Defined at line 1758 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void NotifyDispatcherShutdown (driver_runtime::Dispatcher & dispatcher, fdf_dispatcher_shutdown_observer_t * dispatcher_shutdown_observer)
Notifies the dispatcher coordinator that a dispatcher has completed shutdown.
|dispatcher_shutdown_observer| is the observer to call.
Defined at line 1899 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void RemoveDispatcher (Dispatcher & dispatcher)
Defined at line 1972 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx_status_t Start (uint32_t options)
Defined at line 1996 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void EnvReset ()
static
Defined at line 2010 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void Reset ()
Resets to 0 threads.
Must only be called when there are no outstanding dispatchers.
Must not be called from within a driver_runtime managed thread as that will result in a
deadlock.
Defined at line 2015 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
std::optional<Dispatcher::ThreadPool *> GetThreadPool (std::string_view scheduler_role)
Returns the thread pool for |scheduler_role| if it exists.
Defined at line 2028 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
zx::result<Dispatcher::ThreadPool *> GetOrCreateThreadPool (std::string_view scheduler_role)
Returns the thread pool for |scheduler_role|.
If the thread pool does not exists, creates the thread pool and starts the initial thread.
Defined at line 2038 of file ../../src/devices/bin/driver_runtime/dispatcher.cc
void DestroyThreadPool (Dispatcher::ThreadPool * thread_pool)
This will schedule the thread pool to be deleted on a thread on the default thread pool.
Defined at line 2065 of file ../../src/devices/bin/driver_runtime/dispatcher.cc