Re: Make a NSThread fall asleep and awake it.
Re: Make a NSThread fall asleep and awake it.
- Subject: Re: Make a NSThread fall asleep and awake it.
- From: Nathan Day <email@hidden>
- Date: Wed, 10 Nov 2004 15:50:01 +1100
There are two ways you can do this depend.
1. You can use a NSLock just lock the NSLock do some work the unlock an NSLock it again. in you main thread you can lock the NSLock every time you want to pause the second thread.
2. You can set up a NSRunLoop and use DO.
On Wednesday, November 10, 2004, at 02:17AM, ROUGE Alex <email@hidden> wrote:
>Hello everybody,
>I have some threads in my application, created using the following
>command...
>
> [NSThread detachNewThreadSelector:@selector(generationNumber)
>toTarget:self withObject:nil];
>
>Then on my generationNumber process I put those lines...
>
> NSAutoreleasePool * localPool = [[NSAutoreleasePool alloc] init];
>...
>...
>...
>
> [localPool release];
>
>On the generation process I just do a while which print number from 0
>to n
>
>Then, I wish I can make this thread sleep, like...
>If I press a button, the process would be sleepy and then make it awake.
>
>In fact generationProcess must fall asleep by itself.
>I use this to make a callback in fact, so thank for your nices replies.
>
>Alex
> _______________________________________________
>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
>
Nathan Day
email@hidden
http://homepage.mac.com/nathan_day/
_______________________________________________
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