diff --git a/ChangeLog b/ChangeLog index 222face4d..0ccda2529 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Sat Nov 01 07:05:00 2003 Richard Frith-Macdonald + + * Source/NSNotificationCenter.m: Simplify locking code as original + code was hanging in GNUMail after Davids recent locking changes ... + not sure what the actual problem was, so this change may have merely + re-hidden a bug :-( + * Source/Additions/Unicode.m: Simplify to use non-recursive lock. + 2003-10-31 David Ayers * Source/NSCharacterSet.m diff --git a/Source/Additions/GSCategories.m b/Source/Additions/GSCategories.m index 58f2f1a23..6676c8bdf 100644 --- a/Source/Additions/GSCategories.m +++ b/Source/Additions/GSCategories.m @@ -893,7 +893,7 @@ static NSRecursiveLock *local_lock = nil; @interface _GSLockInitializer : NSObject @end @implementation _GSLockInitializer -+ (void)initialize ++ (void) initialize { if (local_lock == nil) { @@ -957,7 +957,7 @@ newLockAt(Class self, SEL _cmd, id *location) * * */ -+ (id)newLockAt:(id *)location ++ (id) newLockAt: (id *)location { return newLockAt(self, _cmd, location); } @@ -987,7 +987,7 @@ newLockAt(Class self, SEL _cmd, id *location) * * */ -+ (id)newLockAt:(id *)location ++ (id) newLockAt: (id *)location { return newLockAt(self, _cmd, location); } diff --git a/Source/Additions/Unicode.m b/Source/Additions/Unicode.m index 1d44305c9..f2cd5f24d 100644 --- a/Source/Additions/Unicode.m +++ b/Source/Additions/Unicode.m @@ -122,7 +122,7 @@ internal_unicode_enc(void) #endif -static NSRecursiveLock *local_lock = nil; +static GSLazyLock *local_lock = nil; typedef unsigned char unc; static NSStringEncoding defEnc = GSUndefinedEncoding; @@ -210,7 +210,7 @@ static void GSSetupEncodingTable(void) { if (encodingTable == 0) { - [GS_INITIALIZED_LOCK(local_lock, GSLazyRecursiveLock) lock]; + [GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock]; if (encodingTable == 0) { static struct _strenc_ **encTable = 0; @@ -328,7 +328,8 @@ GetAvailableEncodings() { if (_availableEncodings == 0) { - [GS_INITIALIZED_LOCK(local_lock, GSLazyRecursiveLock) lock]; + GSSetupEncodingTable(); + [GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock]; if (_availableEncodings == 0) { NSStringEncoding *encodings; @@ -342,7 +343,6 @@ GetAvailableEncodings() * This is also the place where we determine the name we use * for iconv to support unicode. */ - GSSetupEncodingTable(); encodings = objc_malloc(sizeof(NSStringEncoding) * (encTableSize+1)); pos = 0; for (i = 0; i < encTableSize+1; i++) @@ -562,15 +562,15 @@ GetDefEncoding() char *encoding; unsigned int count; - [GS_INITIALIZED_LOCK(local_lock, GSLazyRecursiveLock) lock]; + GSSetupEncodingTable(); + + [GS_INITIALIZED_LOCK(local_lock, GSLazyLock) lock]; if (defEnc != GSUndefinedEncoding) { [local_lock unlock]; return defEnc; } - GSSetupEncodingTable(); - encoding = getenv("GNUSTEP_STRING_ENCODING"); if (encoding != 0) {