diff --git a/ChangeLog b/ChangeLog index a78bdfd85..e2acdb50f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-04-08 Wolfgang Lux + + * Source/NSOperation.m (_thread): Fix potential deadlock when + exiting a thread. + 2025-04-01 Richard Frith-Macdonald * Source/NSOrderedSet.m: Fix for git issue #500 diff --git a/Source/NSOperation.m b/Source/NSOperation.m index a902a455c..ff03189b7 100644 --- a/Source/NSOperation.m +++ b/Source/NSOperation.m @@ -1043,12 +1043,12 @@ static NSOperationQueue *mainQueue = nil; if ([internal->starting count] == 0) { // Idle for 5 seconds ... exit thread. + [internal->cond unlock]; [[[NSThread currentThread] threadDictionary] removeObjectForKey: threadKey]; [internal->lock lock]; internal->threadCount--; [internal->lock unlock]; - [internal->cond unlock]; break; } /* An operation was added in the gap between the failed wait for