title: How to put only one thread to sleep?
body: <p>I want to create two threads in my game. One thread is for timer and other for touch events. Because when I am running my game on iPhone, timer conflicts with touch events and touch events are not reported. It works smooth in simulator but on iPhone or on iPod Touch it's becomes very slow. So I'm using separate threads for touch events and timer.</p>
  
  <p>When I use <code>[NSThread sleepForTimeInterval:0.01]</code> it makes all threads sleep. I mean touch events are also stop to come through. I want to stop the timer thread only.</p>
  
  <p>This is my code:</p>
  
  <pre><code>-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
  {
      NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  
      BOOL Done = NO;
      while (!Done)
      {
          NSAutoreleasePool *loopPool = [[NSAutoreleasePool alloc] init];
          [NSThread sleepForTimeInterval:0.01];
          [self performSelectorOnMainThread:@selector(callTapCode) withObject:tapView waitUntilDone:YES];
  
          //performSelectorOnMainThread:@selector(callTapCode) withObject:nil waitUntilDone:YES];
  
          [loopPool release];
          Done=YES;
      }
  
      [pool drain];
  }
  </code></pre>