title: Possible issues with sqlite3_mutex_enter(v->db->mutex) on cocoa c
body: <p>I have an issue with the <code>sqlite3_mutex_enter(v-&gt;db-&gt;mutex)</code> error message on an iOS application.
  The case is the following: I developed an application that is performing a sync on the application in the background while starting up. All SQL Statements that invoke writing to the DB are protected using a <code>NSLOCK</code> and are unlocked after the finalize.
  Now the problem is, that the Application User can start working with the application while the sync is still ongoing. Sometimes I do get now an <code>sqlite3_mutex_enter(v-&gt;db-&gt;mutex)</code> when something is done on the DB level, sometimes it simply works. The cases where this error appears is mainly in read statements. </p>
  
  <p>Do you have any ideas when the <code>sqlite3_mutex_enter(v-&gt;db-&gt;mutex)</code> error can show up? All statements are finalized properly. Something really weird is, that the SQLITE DB tries to close itself even if there is no command that tells the DB connection to close.</p>