mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-11 00:30:49 +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>
|
2025-04-01 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/NSOrderedSet.m: Fix for git issue #500
|
* Source/NSOrderedSet.m: Fix for git issue #500
|
||||||
|
|
|
@ -1043,12 +1043,12 @@ static NSOperationQueue *mainQueue = nil;
|
||||||
if ([internal->starting count] == 0)
|
if ([internal->starting count] == 0)
|
||||||
{
|
{
|
||||||
// Idle for 5 seconds ... exit thread.
|
// Idle for 5 seconds ... exit thread.
|
||||||
|
[internal->cond unlock];
|
||||||
[[[NSThread currentThread] threadDictionary]
|
[[[NSThread currentThread] threadDictionary]
|
||||||
removeObjectForKey: threadKey];
|
removeObjectForKey: threadKey];
|
||||||
[internal->lock lock];
|
[internal->lock lock];
|
||||||
internal->threadCount--;
|
internal->threadCount--;
|
||||||
[internal->lock unlock];
|
[internal->lock unlock];
|
||||||
[internal->cond unlock];
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
/* An operation was added in the gap between the failed wait for
|
/* An operation was added in the gap between the failed wait for
|
||||||
|
|
Loading…
Reference in a new issue