simple locking bug fixed.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9756 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2001-05-02 11:52:43 +00:00
parent d857153423
commit 2bf97c997a
2 changed files with 10 additions and 6 deletions

View file

@ -1,3 +1,7 @@
2001-05-02 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTimeZone: ([-initWithName:]) fix for trivial locking bug.
2001-04-30 Adam Fedor <fedor@gnu.org> 2001-04-30 Adam Fedor <fedor@gnu.org>
* Source/behavior.m: Rewrite to work with NeXT runtime. * Source/behavior.m: Rewrite to work with NeXT runtime.

View file

@ -366,20 +366,20 @@ decode (const void *ptr)
} }
/* /*
* Return a chached time zone if possible. * Return a cached time zone if possible.
*/ */
if (zone_mutex != nil) if (zone_mutex != nil)
{ {
[zone_mutex lock]; [zone_mutex lock];
} }
zone = [zoneDictionary objectForKey: name]; zone = [zoneDictionary objectForKey: name];
IF_NO_GC(RETAIN(zone));
if (zone_mutex != nil)
{
[zone_mutex unlock];
}
if (zone != nil) if (zone != nil)
{ {
IF_NO_GC(RETAIN(zone));
if (zone_mutex != nil)
{
[zone_mutex unlock];
}
return zone; return zone;
} }