[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");
} else {
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);
if(result != 0) {
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);
if(result != 0) {
DLog(@"Deadline end error = %d", result);
isRealtimeError = YES;
}
}
}