mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
fix potential deadlock
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38951 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
1fbc464141
commit
00571cd74e
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,7 @@
|
|||
2015-08-30 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSOperation.m: Fix potential deadlock with adding observers.
|
||||
|
||||
2015-08-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/GSMime.m: Improve descriptions for debug.
|
||||
|
|
|
@ -886,9 +886,12 @@ static NSOperationQueue *mainQueue = nil;
|
|||
internal->executing--;
|
||||
[object removeObserver: self
|
||||
forKeyPath: @"isFinished"];
|
||||
[internal->lock unlock];
|
||||
[self willChangeValueForKey: @"operations"];
|
||||
[self willChangeValueForKey: @"operationCount"];
|
||||
[internal->lock lock];
|
||||
[internal->operations removeObjectIdenticalTo: object];
|
||||
[internal->lock unlock];
|
||||
[self didChangeValueForKey: @"operationCount"];
|
||||
[self didChangeValueForKey: @"operations"];
|
||||
}
|
||||
|
@ -897,8 +900,8 @@ static NSOperationQueue *mainQueue = nil;
|
|||
[object removeObserver: self
|
||||
forKeyPath: @"isReady"];
|
||||
[internal->waiting addObject: object];
|
||||
[internal->lock unlock];
|
||||
}
|
||||
[internal->lock unlock];
|
||||
[self _execute];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue