Introduce is_locked

This commit is contained in:
gwenn
2018-03-31 10:22:19 +02:00
parent cccdf9735f
commit a0151f9073
3 changed files with 23 additions and 11 deletions

View File

@@ -34,7 +34,10 @@ impl RawStatement {
let mut rc;
loop {
rc = unsafe { ffi::sqlite3_step(self.0) };
rc = unlock_notify::wait_for_unlock_notify(self.1, rc);
if !unlock_notify::is_locked(self.1, rc) {
break;
}
rc = unlock_notify::wait_for_unlock_notify(self.1);
if rc != ffi::SQLITE_OK {
break;
}