From f4ab1c1264cc85df194e8af4ecf18d2335078040 Mon Sep 17 00:00:00 2001 From: theraven Date: Wed, 30 Sep 2009 12:40:00 +0000 Subject: [PATCH] Fixed bug in -lockWhenCondition:beforeDate: (was not releasing mutex correctly). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28752 72102866-910b-0410-8b05-ffd578937521 --- Source/NSLock.m | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Source/NSLock.m b/Source/NSLock.m index 65f2cc791..2a783f04b 100644 --- a/Source/NSLock.m +++ b/Source/NSLock.m @@ -372,17 +372,16 @@ MUNLOCK - (BOOL) lockWhenCondition: (NSInteger)condition_to_meet beforeDate: (NSDate*)limitDate { + BOOL ret; [_condition lock]; if (condition_to_meet == _condition_value) { return YES; } - if ([_condition waitUntilDate: limitDate] - && (condition_to_meet == _condition_value)) - { - return YES; - } - return NO; + ret = [_condition waitUntilDate: limitDate] + && (condition_to_meet == _condition_value); + [_condition unlock]; + return ret; } MNAME