diff --git a/common/JackClient.cpp b/common/JackClient.cpp index 74a9dca87..1518aa1d5 100644 --- a/common/JackClient.cpp +++ b/common/JackClient.cpp @@ -639,13 +639,6 @@ inline bool JackClient::WaitSync() { // Suspend itself: wait on the input synchro if (GetGraphManager()->SuspendRefNum(GetClientControl(), fSynchroTable, LONG_MAX) < 0) { -#ifdef __APPLE__ - // FIXME macOS reports wait failures when closing down, due to aborted semaphore, ignore it - if (!GetClientControl()->fActive) { - fThread.Terminate(); - return true; - } -#endif jack_error("SuspendRefNum error"); return false; } else { diff --git a/macosx/JackMachThread.mm b/macosx/JackMachThread.mm index b42de3e7d..68ece1248 100644 --- a/macosx/JackMachThread.mm +++ b/macosx/JackMachThread.mm @@ -46,7 +46,7 @@ #endif theTCPolicy.preemptible = true; kern_return_t res = thread_policy_set(pthread_mach_thread_np(thread), THREAD_TIME_CONSTRAINT_POLICY, (thread_policy_t) &theTCPolicy, THREAD_TIME_CONSTRAINT_POLICY_COUNT); - jack_log("JackMachThread::thread_policy_set res = %ld", res); + jack_log("JackMachThread::thread_policy_set RT res = %ld", res); return (res == KERN_SUCCESS) ? 0 : -1; } else { // OTHER THREADS @@ -69,7 +69,7 @@ thePrecedencePolicy.importance = relativePriority; kern_return_t res = thread_policy_set(pthread_mach_thread_np(thread), THREAD_PRECEDENCE_POLICY, (thread_policy_t) &thePrecedencePolicy, THREAD_PRECEDENCE_POLICY_COUNT); - jack_log("JackMachThread::thread_policy_set res = %ld", res); + jack_log("JackMachThread::thread_policy_set non-RT res = %ld", res); return (res == KERN_SUCCESS) ? 0 : -1; } } @@ -160,21 +160,16 @@ int JackMachThread::Kill() { -#if 0 - // NOTE: starting macOS 12, this code no longer works if (fThread != (jack_native_thread_t)NULL) { // If thread has been started jack_log("JackMachThread::Kill"); mach_port_t machThread = pthread_mach_thread_np(fThread); - int res = (thread_terminate(machThread) == KERN_SUCCESS) ? 0 : -1; + int res = (thread_abort(machThread) == KERN_SUCCESS) ? 0 : -1; fStatus = kIdle; fThread = (jack_native_thread_t)NULL; return res; } else { return -1; } -#else - return JackPosixThread::Kill(); -#endif } int JackMachThread::AcquireRealTime() diff --git a/posix/JackSocket.cpp b/posix/JackSocket.cpp index 4039679de..40887a0ca 100644 --- a/posix/JackSocket.cpp +++ b/posix/JackSocket.cpp @@ -202,7 +202,7 @@ int JackClientSocket::Read(void* data, int len) jack_error("Cannot read socket fd = %d res = %d err = %s", fSocket, res, strerror(errno)); //return 0; return -1; - } else if (errno == 0) { + } else if (errno == 0 || errno == ENOTCONN) { // aborted reading due to shutdown return JACK_REQUEST_ERR_ABORTED; } else {