title: See what causes deadlock on pthread_mutex_lock
body: <p>I have a Core Data iOS app that uses private queue concurrency in a background process. I'm getting a deadlock that makes the UI freeze up from time to time (fairly regularly, to be honest) - but all the info I get from the debugger (LLDB) is that it is stuck on pthread_mutex_lock. The stack trace is no longer than that, which makes debugging near on impossible:</p>
  
  <pre><code>thread #1: tid = 0x2503, 0x3b5060fc libsystem_kernel.dylib`__psynch_mutexwait + 24, stop reason = signal SIGSTOP
  frame #0: 0x3b5060fc libsystem_kernel.dylib`__psynch_mutexwait + 24
  frame #1: 0x3b44f128 libsystem_c.dylib`pthread_mutex_lock + 392
  </code></pre>
  
  <p>The XCode process pane is similarly only showing those two entries on the stack.</p>
  
  <p>I'm quite new to this multithreading stuff so am at a total loss where to begin with fixing the issue. Any suggestions for how to go about debugging this?</p>