title: How do I terminate a thread waiting on @synchronized objective C
body: <p>I have some code like this:</p>
  
  <pre><code>doDatabaseFetch {
     ...
     @synchronized(self) {
        ...
     }
  }
  </code></pre>
  
  <p>and many objects that call doDatabaseFetch as the user uses the view.</p>
  
  <p>My problem is, I have an operation (navigate to the next view) that also requires a database fetch. My problem is that it hits the same synchronize block and waits it's turn! I would ideally like this operation to kill all the threads waiting or give this thread a higher priority so that it can execute immediately. </p>
  
  <p>Apple says that</p>
  
  <blockquote>
    <p>The recommended way to exit a thread is to let it exit its entry point routine normally. Although Cocoa, POSIX, and Multiprocessing Services offer routines for killing threads directly, the use of such routines is strongly discouraged. </p>
  </blockquote>
  
  <p>So I don't think I should kill the threads... but how can I let them exit normally if they're waiting on a synchronized block? Will I have to write my own semaphore to handle this behavior?</p>
  
  <p>Thanks!
  Nick.</p>