Re: Basic thread example?
Re: Basic thread example?
- Subject: Re: Basic thread example?
- From: Alastair Houghton <email@hidden>
- Date: Sat, 28 Feb 2004 23:41:21 +0000
On 28 Feb 2004, at 01:20, email@hidden wrote:
does anyone know if there is one floating around, i don't want my users
to sit and go wtf is this thing doing anything so i want to make a
thread to perform my method and show its progress with a threaded
progress bar but i can't seem to find a basic example i've got this
code but i get mem leaks?
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
BOOL keepGoing = YES;
while( keepGoing )
{
do some stuff
}
keepGoing = NO;
[pool release];
Well for one thing, if you're changing keepGoing from another thread,
you need to declare it volatile (otherwise the loop will never finish).
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.