class ThreadingModel
Defined at line 123 of file ../../src/media/audio/audio_core/threading_model.h
Public Methods
void ~ThreadingModel ()
Defined at line 132 of file ../../src/media/audio/audio_core/threading_model.h
std::unique_ptr<ThreadingModel> CreateWithMixStrategy (MixStrategy mix_strategy, MixProfileConfig mix_profile_config)
Creates a `ThreadingModel` with a provided `MixStrategy`, which configures the behavior of
`AcquireMixDomain`, and a `MixProfileConfig`.
See `MixStrategy` for more details on possible strategies.
Defined at line 202 of file ../../src/media/audio/audio_core/threading_model.cc
ExecutionDomain & FidlDomain ()
Returns the `ExecutionDomain` used to run the primary |fuchsia::media::AudioCore| FIDL
service. This domain will be valid for the lifetime of this object.
This is a single-threaded dispatcher.
ExecutionDomain & IoDomain ()
Returns the `ExecutionDomain` used to run blocking IO. This domain will be valid for the
the lifetime of this object.
This is a single-threaded dispatcher.
OwnedDomainPtr AcquireMixDomain (const std::string & name_hint)
Acquires an `ExecutionDomain` to use for mixing. The returned domain will live as long as the
returned pointer.
It is implementation defined if tasks will still execute after the returned `OwnedDomainPtr` is
released; for shared dispatcher implementations these tasks will still run, while
implementations that provide a unique dispatcher may choose to immediately shutdown the loop in
response to the `OwnedDomainPtr` being released.
This is a single-threaded dispatcher.
void RunAndJoinAllThreads ()
Runs all the dispatchers. When the message loop backing |FidlDomain()| exits, the remaining
domains will all be shutdown.
When this method returns, all threads will be joined and all dispatchers stopped.
void Quit ()
Shuts down all `ExecutionDomains` provided by this `ThreadingModel`, causing
`RunAndJoinAllThreads` to eventually return.
This posts the quit operation to all message loops managed by this object, meaning all
currently runnable tasks in each loop will have an opportunity to run before the loop exits.