Fix problem with lazy locks by setting multithreaded bool earlier

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18839 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2004-03-12 16:51:30 +00:00
parent bd1a02569a
commit 5978eda5cf
2 changed files with 10 additions and 1 deletions

View file

@ -3,6 +3,9 @@
* Source/Additions/GSCategories.m:
* Source/Additions/GSMime.m: New uuencode/uudecode moved from
GSMime to a category of NSData and renamed.
* Source/NSThread.m: Set flag to saay we are multithreaded before
we send out the notifications. Fixes bug in lazy locking and is
more compatible with macos-x
Fri Mar 12 13:35:25 2004 Nicola Pero <n.pero@mi.flashnet.it>

View file

@ -382,6 +382,13 @@ gnustep_base_thread_callback(void)
[gnustep_global_lock lock];
if (entered_multi_threaded_state == NO)
{
/*
* For apple compatibility ... and to make things easier for
* code called indirectly within a will-become-multi-threaded
* notification handler, we set the flag to say we are multi
* threaded BEFORE sending the notifications.
*/
entered_multi_threaded_state = YES;
NS_DURING
{
[GSPerformHolder class]; // Force initialization
@ -408,7 +415,6 @@ gnustep_base_thread_callback(void)
fflush(stderr);
}
NS_ENDHANDLER
entered_multi_threaded_state = YES;
}
[gnustep_global_lock unlock];
}