Locking tidups/fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@18016 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-11-01 07:09:12 +00:00
parent b5dd8fa367
commit 248f589502
3 changed files with 18 additions and 10 deletions

View file

@ -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)
*
* </example>
*/
+ (id)newLockAt:(id *)location
+ (id) newLockAt: (id *)location
{
return newLockAt(self, _cmd, location);
}
@ -987,7 +987,7 @@ newLockAt(Class self, SEL _cmd, id *location)
*
* </example>
*/
+ (id)newLockAt:(id *)location
+ (id) newLockAt: (id *)location
{
return newLockAt(self, _cmd, location);
}

View file

@ -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)
{