> Given that, could you give a really simple example of how to
> coordinate access between the three methods?

First, your lock is an instance variable of the class, so in init you alloc
& init it, and in dealloc you release it...

- (void) methodA
{
    [myLock tryLockBeforeDate: [NSDate distantFuture]];
    // do your stuff here
    [myLock unlock];
}

- (void) methodB
{
    [myLock tryLockBeforeDate: [NSDate distantFuture]];
    // do your stuff here
    [myLock unlock];
}

- (void) methodC
{
    [myLock tryLockBeforeDate: [NSDate distantFuture]];
    // do your stuff here
    [myLock unlock];
}


-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to