Manages real-time thread priority for audio processing threads.
More...
#include <workgroup.hpp>
Manages real-time thread priority for audio processing threads.
On macOS 11.0+, uses os_workgroup to join the audio device's workgroup, ensuring the thread gets real-time scheduling priority aligned with the audio device's deadline.
On other platforms, falls back to setting high thread priority via platform-specific APIs.
bool leave()
Leave on the joining thread and restore any scoped Mach scheduling change.
Definition workgroup.hpp:83
bool join_from_audio_thread()
Join the audio workgroup from the current thread.
Definition workgroup.hpp:58
◆ AudioWorkgroup() [1/2]
| pulp::audio::AudioWorkgroup::AudioWorkgroup |
( |
| ) |
|
|
default |
◆ ~AudioWorkgroup()
| pulp::audio::AudioWorkgroup::~AudioWorkgroup |
( |
| ) |
|
|
inline |
◆ AudioWorkgroup() [2/2]
| pulp::audio::AudioWorkgroup::AudioWorkgroup |
( |
const AudioWorkgroup & | | ) |
|
|
delete |
◆ is_joined()
| bool pulp::audio::AudioWorkgroup::is_joined |
( |
| ) |
const |
|
inline |
Check if the current thread has joined the workgroup.
◆ join_from_audio_thread()
| bool pulp::audio::AudioWorkgroup::join_from_audio_thread |
( |
| ) |
|
|
inline |
Join the audio workgroup from the current thread.
Call this once from the audio processing thread.
- Returns
- True if successfully joined.
◆ leave()
| bool pulp::audio::AudioWorkgroup::leave |
( |
| ) |
|
|
inline |
Leave on the joining thread and restore any scoped Mach scheduling change.
- Returns
- False if restoration failed; state is retained so leave can be retried.
◆ operator=()
◆ set_high_priority()
| bool pulp::audio::AudioWorkgroup::set_high_priority |
( |
| ) |
|
|
inlinestatic |
Set high (but not real-time) thread priority.
◆ set_realtime_priority()
| bool pulp::audio::AudioWorkgroup::set_realtime_priority |
( |
| ) |
|
|
inlinestatic |
Set real-time thread priority without a workgroup (best-effort).
Useful when a workgroup is not available (standalone apps).
◆ set_workgroup()
| void pulp::audio::AudioWorkgroup::set_workgroup |
( |
os_workgroup_t | workgroup | ) |
|
|
inline |
Set the workgroup from an AudioUnit or CoreAudio device.
- Parameters
-
| workgroup | An os_workgroup_t obtained from the audio device. |
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/audio/include/pulp/audio/workgroup.hpp