title: @synchronized() and NSLock differences
body: <p>I have a block of code that is accessed frequently and from either the main thread or several other background threads. I need to ensure that this code only gets processed one at a time.</p>
  
  <p>I'm currently using a <code>@synchronized(self) { }</code> block but I'm not sure if that's providing the correct protection. How does it differ from an <code>NSLock</code> instance?</p>
  
  <p>Finally, can anyone suggest how I can protect my method? The method is in my application delegate, and I access it from various threads by calling:</p>
  
  <pre><code>[[[UIApplication sharedApplication] delegate] myMethod];
  </code></pre>
  
  <p>Many thanks,</p>
  
  <p>Mike</p>