mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-10 16:20:42 +00:00
Fix potential deadlock in NSOperationQueue when exiting a background thread
This commit is contained in:
parent
b39853e21a
commit
f6e6b05f48
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2025-04-08 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSOperation.m (_thread): Fix potential deadlock when
|
||||
exiting a thread.
|
||||
|
||||
2025-04-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSOrderedSet.m: Fix for git issue #500
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue