[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #25307] [NSConditionLock tryLockWhenCondition:] shouldn't throw exc

From: Doug Simons
Subject: [bug #25307] [NSConditionLock tryLockWhenCondition:] shouldn't throw exception when lock is unavailable
Date: Sun, 18 Jan 2009 20:57:36 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_4_11; en) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1

Follow-up Comment #6, bug #25307 (project gnustep):

> > The point of "tryLock" and "tryLockWhenCondition:" is to attempt to do
> > lock and return NO, if it can't.

> Sure ... but the rationale was that, if the lock is held by the current
> thread then calling it is evidence of a probable bug.

In the code I'm porting it wasn't evidence of a bug, although it might be
argued that it was evidence of some laziness in coding. :-) 

In any case, I didn't file this bug report because GNUstep's philosophy
seemed wrong, but because its behavior was different from Cocoa's. At this
point I've cleaned up my code so it no longer tries the lock when it already
holds it, but I thought you'd like to know that Cocoa simply returns NO on the
"try..." methods if it's not able to obtain the lock (for whatever reason).


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]