mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Don't try to notify about task termination on the thread that started the task
if it has already finished executing.
This commit is contained in:
parent
5bdcd3c698
commit
28048a5947
3 changed files with 7 additions and 8 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
* Source/NSThread.m: Improve exception message when performing a
|
||||
selector on a finished thread.
|
||||
* Source/NSTask.m: Do not try to notify task completion on a thread
|
||||
that is not executing.
|
||||
* configure.ac: Fix for older versions of pkg-config
|
||||
* configure: regenerate
|
||||
|
||||
|
|
|
@ -414,11 +414,7 @@ pty_slave(const char* name)
|
|||
*/
|
||||
- (void) launch
|
||||
{
|
||||
if (_launchingThread != [NSThread currentThread])
|
||||
{
|
||||
[_launchingThread release];
|
||||
_launchingThread = [[NSThread currentThread] retain];
|
||||
}
|
||||
ASSIGN(_launchingThread, [NSThread currentThread]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -937,7 +933,7 @@ pty_slave(const char* name)
|
|||
if (_hasNotified == NO)
|
||||
{
|
||||
_hasNotified = YES;
|
||||
if (_launchingThread != nil)
|
||||
if ([_launchingThread isExecuting] == YES)
|
||||
{
|
||||
[self performSelector: @selector(_notifyOfTermination)
|
||||
onThread: _launchingThread
|
||||
|
|
|
@ -1690,9 +1690,10 @@ GSRunLoopInfoForThread(NSThread *aThread)
|
|||
if ([aThread isFinished] == YES)
|
||||
{
|
||||
[NSException raise: NSInternalInconsistencyException
|
||||
format: @"perform [%@-%@] attempted on finished thread",
|
||||
format: @"perform [%@-%@] attempted on finished thread (%@)",
|
||||
NSStringFromClass([self class]),
|
||||
NSStringFromSelector(aSelector)];
|
||||
NSStringFromSelector(aSelector),
|
||||
aThread];
|
||||
}
|
||||
if (aFlag == YES)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue