class DispatcherCoordinator

Defined at line 22 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

Coordinator for all dispatchers in a process.

Public Methods

void WaitUntilDispatchersIdle ()

static

Defined at line 22 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void DispatcherCoordinator ()

We default to no threads, and start additional threads when blocking dispatchers are created.

Defined at line 25 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

bool AreAllDriversDestroyedLocked ()

Defined at line 73 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

ThreadPool * default_thread_pool ()

Defined at line 91 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

ThreadPool * GetOrCreateUnmanagedThreadPool ()

Returns the unmanaged thread pool. Creates it first if it doesn't exist.

Defined at line 94 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

bool dynamic_thread_spawning ()

Defined at line 102 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

bool enforce_allowed_scheduler_roles ()

Defined at line 104 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.h

void DestroyAllDispatchers ()

static

Defined at line 212 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void WaitUntilDispatchersDestroyed ()

static

Defined at line 36 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t TestingRun (zx::time deadline, bool once)

static

Defined at line 46 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t TestingRunUntilIdle ()

static

Defined at line 57 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void TestingQuit ()

static

Defined at line 68 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t TestingResetQuit ()

static

Defined at line 77 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t ShutdownDispatchersAsync (const void * driver, fdf_env_driver_shutdown_observer_t * observer)

static

Defined at line 88 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t SuspendDispatchersAsync (const void * driver, fdf_env_suspend_completer_t * completer)

static

Defined at line 131 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void ResumeDispatchers (const void * driver)

static

Defined at line 172 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void RegisterResumeRequester (const void * driver, fdf_env_resume_requester_t * requester)

static

Defined at line 193 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t TokenRegister (zx_handle_t token, fdf_dispatcher_t * dispatcher, fdf_token_t * handler)

Implementation of fdf_token_*.

Defined at line 235 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t TokenReceive (zx_handle_t token, fdf_handle_t * handle)

static

Defined at line 242 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t TokenTransfer (zx_handle_t token, fdf_handle_t channel)

static

Defined at line 248 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

uint32_t GetThreadLimit (std::string_view scheduler_role)

Implementation of fdf_env_*.

Defined at line 355 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t SetThreadLimit (std::string_view scheduler_role, uint32_t max_threads)

static

Defined at line 371 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

uint32_t GetSchedulerRoleOpts (std::string_view scheduler_role)

static

Defined at line 388 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t SetSchedulerRoleOpts (std::string_view scheduler_role, uint32_t opts)

static

Defined at line 404 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_duration_mono_t ScanThreadsForStalls ()

Defined at line 420 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void RegisterStallScanner (fdf_env_stall_scanner_t * stall_scanner)

Defined at line 438 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void TriggerStallScanner ()

Defined at line 442 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t AddDispatcher (fbl::RefPtr<Dispatcher> dispatcher, std::string_view scheduler_role, std::unique_ptr<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 253 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t AddUnmanagedDispatcher (fbl::RefPtr<Dispatcher> dispatcher, std::unique_ptr<EventWaiter> event_waiter)

Defined at line 307 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.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 449 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void RemoveDispatcher (Dispatcher & dispatcher)

Defined at line 522 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx_status_t Start (uint32_t options)

Defined at line 546 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void EnvReset ()

static

Defined at line 559 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.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 564 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

std::optional<ThreadPool *> GetThreadPool (std::string_view scheduler_role)

Returns the thread pool for |scheduler_role| if it exists.

Defined at line 578 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

zx::result<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 587 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc

void DestroyThreadPool (ThreadPool * thread_pool)

This will schedule the thread pool to be deleted on a thread on the default thread pool.

Defined at line 614 of file ../../src/devices/bin/driver_runtime/dispatcher_coordinator.cc