[Audio Threads] Add further safety gating on error

Errors should stop all attempts to further use the audio thread priority
code, so there won't be debug breakpoints called on older OSes.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-10 15:20:07 -07:00
parent 1c9887053c
commit 22a41e71d3
1 changed files with 3 additions and 0 deletions

View File

@ -227,6 +227,7 @@ BOOL SetPriorityRealtimeAudio(mach_port_t mach_thread_id) {
DLog(@"Thread already in workgroup"); DLog(@"Thread already in workgroup");
} else { } else {
DLog(@"Cannot join workgroup, error %d", result); DLog(@"Cannot join workgroup, error %d", result);
isRealtimeError = YES;
} }
} }
} }
@ -255,6 +256,7 @@ BOOL SetPriorityRealtimeAudio(mach_port_t mach_thread_id) {
int result = os_workgroup_interval_start(wg, currentTime, deadline, nil); int result = os_workgroup_interval_start(wg, currentTime, deadline, nil);
if(result != 0) { if(result != 0) {
DLog(@"Deadline error = %d", result); DLog(@"Deadline error = %d", result);
isRealtimeError = YES;
} }
} }
} }
@ -266,6 +268,7 @@ BOOL SetPriorityRealtimeAudio(mach_port_t mach_thread_id) {
int result = os_workgroup_interval_finish(wg, nil); int result = os_workgroup_interval_finish(wg, nil);
if(result != 0) { if(result != 0) {
DLog(@"Deadline end error = %d", result); DLog(@"Deadline end error = %d", result);
isRealtimeError = YES;
} }
} }
} }