• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Thread crashing problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Thread crashing problem


  • Subject: Re: Thread crashing problem
  • From: Scott Ribe <email@hidden>
  • Date: Mon, 22 Dec 2008 09:40:48 -0700
  • Thread-topic: Thread crashing problem

> 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
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Thread crashing problem
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Thread crashing problem (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: NSCalendar/NSDate - generating all months/days in a year [SOLVED]
  • Next by Date: Re: NSCalendar/NSDate - generating all months/days in a year [SOLVED]
  • Previous by thread: Re: Thread crashing problem
  • Next by thread: Re: Thread crashing problem
  • Index(es):
    • Date
    • Thread