in src/backend/mod.rs [2483:2507]
fn new() -> Self {
let queue_label = format!("{}.context", DISPATCH_QUEUE_LABEL);
let serial_queue =
Queue::new_with_target(queue_label.as_str(), get_serial_queue_singleton());
let shared_vp_queue = Queue::new_with_target(
format!("{}.context.shared_vpio", DISPATCH_QUEUE_LABEL).as_str(),
&serial_queue,
);
let host_time_to_ns_ratio = {
let mut timebase_info = mach_timebase_info { numer: 0, denom: 0 };
unsafe {
mach_timebase_info(&mut timebase_info);
}
(timebase_info.numer, timebase_info.denom)
};
Self {
_ops: &OPS as *const _,
serial_queue,
latency_controller: Mutex::new(LatencyController::default()),
devices: Mutex::new(SharedDevices::default()),
host_time_to_ns_ratio,
shared_voice_processing_unit: SharedVoiceProcessingUnitManager::new(shared_vp_queue),
devids: Arc::new(Mutex::new(intern::Intern::new())),
}
}