I have a strange situation where a while loop is causing my cpu usage to go to between 90 and 100%. The cpu stays this high. If I comment out the while loop the cpu remains normal.
Whats going wrong here?
I've put in a breakpoint and the while loop definitely does exit.
[self performSelectorInBackground:@selector(checkstate:) withObject:padid];
-(void)checkstate:(PadIDSIdentifier*)pids
{
int pid=0;
int cid=0;
pid=pids.padid;
cid=pids.channelid;
NSAutoreleasePool *pool=[[NSAutoreleasePool alloc]init];
while (change==NO)
{
// wait for the condition I want
change=YES;
}
[pool release];
}