mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
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:
parent
b5dd8fa367
commit
248f589502
3 changed files with 18 additions and 10 deletions
|
@ -1,3 +1,11 @@
|
|||
Sat Nov 01 07:05:00 2003 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* 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 <d.ayers@inode.at>
|
||||
|
||||
* Source/NSCharacterSet.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)
|
|||
*
|
||||
* </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);
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue