Am I using NSConditionLock correctly?
Am I using NSConditionLock correctly?
- Subject: Am I using NSConditionLock correctly?
- From: Steve Weller <email@hidden>
- Date: Sun, 9 Oct 2005 22:53:48 -0700
I am using NSConditionLock to delay the completion of a method while
another thread completes. I am not sure that I am using it correctly,
since my conditional lock hangs up the program.
In my worker thread I do [calculatingLock lock]; [calculatingLock
unlockWithCondition:YES] when calculation starts and [calculatingLock
lock]; [calculatingLock unlockWithCondition:NO] when it stops.
In my method that depends on the worker thread stopping I do
[calculatingLock lockWhenCondition:NO]; [calculatingLock
unlockWithCondition:NO]. The idea is that it should wait for the
condition to be set to NO before continuing. It hangs at this point.
If this is all correct then my problem lies elsewhere.
More information on my blog, URL below.
--
Watch me learn Cocoa http://homepage.mac.com/bagelturf/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden