From d5345b8bd619ab9c49a128403bd3ad00940cec6d Mon Sep 17 00:00:00 2001 From: Richard Frith-Macdonald Date: Fri, 12 Mar 2004 16:51:30 +0000 Subject: [PATCH] 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 --- ChangeLog | 3 +++ Source/NSThread.m | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2c64eabd8..b33deceac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/Source/NSThread.m b/Source/NSThread.m index 164576173..fc0faea08 100644 --- a/Source/NSThread.m +++ b/Source/NSThread.m @@ -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]; }