• 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: Question about Threading
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about Threading


  • Subject: Re: Question about Threading
  • From: Dominic Yu <email@hidden>
  • Date: Wed, 10 Aug 2005 11:53:46 -0700

2005/8/10, Chris Kane <email@hidden>:
> Don't, however, try to solve the synchronization and "wait until the
> background thread is done" by locking a lock in one thread which the
> other thread unlocks.

wait... are you saying that using a BOOL and an NSLock is not OK? for example

- (void)someThread:(id)anObj {
  [aLock lock];
  while (aBool) {
    // do  stuff
  }
  [aLock unlock];
}

- (void)stopAboveThread:(id)sender {
  aBool = NO;
  [aLock lock];
  // do some other stuff
  [aLock unlock];
}

Is this incorrrect code?

-Dominic
 _______________________________________________
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

  • Follow-Ups:
    • Re: Question about Threading
      • From: Chris Kane <email@hidden>
References: 
 >Question about Threading (From: Michael Becker <email@hidden>)
 >Re: Question about Threading (From: Cameron Hayne <email@hidden>)
 >Re: Question about Threading (From: Chris Kane <email@hidden>)

  • Prev by Date: Re: -[NSManagedObjectContext hasChanges] returns 1, yet no visible changes? (was Re: refreshObject:mergeChanges: vs. stale transient properties)
  • Next by Date: Re: Question about Threading
  • Previous by thread: Re: Question about Threading
  • Next by thread: Re: Question about Threading
  • Index(es):
    • Date
    • Thread