Hi,
When trying to use -performSelectorOnMainThread:withObject:
waitUntilDone:, I get the following error message:
"Uncaught exception NSConditionLockException, reason: Thread attempted to
recursively lock"
Apparently there's a race condition in GSPerformHolder. As soon as it
unlocks its condition lock in -fire, the other thread gets the lock and
releases the GSPerformHolder, which then tries to acquire the lock again
in -dealloc.
The attached patch to [GSPerformHolder fire] in NSThread.m should fix it.
Regards
Philip
--
_______________________________________
Philip Derrin <[EMAIL PROTECTED]>
Sun Dec 8 14:03:46 UTC 2002 Philip Derrin <[EMAIL PROTECTED]>
* Source/NSThread.m ([GSPerformHolder -fire]): Fix race condition
diff -u -r1.62 NSThread.m
--- base/Source/NSThread.m 13 Nov 2002 15:12:38 -0000 1.62
+++ base/Source/NSThread.m 8 Dec 2002 13:35:01 -0000
@@ -786,9 +786,10 @@
}
else
{
+ NSConditionLock* l = lock;
[lock lock];
- [lock unlockWithCondition: 1];
lock = nil;
+ [l unlockWithCondition: 1];
}
}
@end
_______________________________________________
Bug-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-gnustep