mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Fix for Deadlock in NSOperationQueue #49: If an exception occurs when trying to detach thread, catch it and log it so that locking is not broken by the exception breaking out of the lock protected region.
This commit is contained in:
parent
6ee0cfff00
commit
6d714c8ee1
1 changed files with 12 additions and 3 deletions
|
@ -1100,9 +1100,18 @@ static NSOperationQueue *mainQueue = nil;
|
|||
|| (pending > 0 && internal->threadCount < POOL))
|
||||
{
|
||||
internal->threadCount++;
|
||||
[NSThread detachNewThreadSelector: @selector(_thread)
|
||||
toTarget: self
|
||||
withObject: nil];
|
||||
NS_DURING
|
||||
{
|
||||
[NSThread detachNewThreadSelector: @selector(_thread)
|
||||
toTarget: self
|
||||
withObject: nil];
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
NSLog(@"Failed to create thread for %@: %@",
|
||||
self, localException);
|
||||
}
|
||||
NS_ENDHANDLER
|
||||
}
|
||||
/* Tell the thread pool that there is an operation to start.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue