Guest User

Untitled

a guest
Aug 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. why is this while loop causing 100% cpu
  2. [self performSelectorInBackground:@selector(checkstate:) withObject:padid];
  3.  
  4.  
  5.  
  6. -(void)checkstate:(PadIDSIdentifier*)pids
  7. {
  8.  
  9. int pid=0;
  10. int cid=0;
  11. pid=pids.padid;
  12. cid=pids.channelid;
  13.  
  14.  
  15. NSAutoreleasePool *pool=[[NSAutoreleasePool alloc]init];
  16.  
  17.  
  18. while (change==NO)
  19. {
  20.  
  21. // wait for the condition I want
  22. change=YES;
  23.  
  24.  
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31. [pool release];
  32.  
  33. }
Add Comment
Please, Sign In to add comment