aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeapi.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2012-06-21 15:51:42 +0000
committerdrh <drh@noemail.net>2012-06-21 15:51:42 +0000
commited68801b202841d67b33c8ce69999ecd659032e8 (patch)
tree409f6054a53aa2c1f3e8eb90d027dd77cdc77cd7 /src/vdbeapi.c
parent567520226aac5bef285e488cdd19f321ea415ccf (diff)
parent4104337270d3183eaa8c88038a8a83602b28e60d (diff)
downloadsqlite-ed68801b202841d67b33c8ce69999ecd659032e8.tar.gz
sqlite-ed68801b202841d67b33c8ce69999ecd659032e8.zip
Add the sqlite3_close_v2() interface (from the deferred-close branch) that
allows close operations to happen out-of-order in bindings to garbage-collected langauges. FossilOrigin-Name: fb8893abeefabe9de44e34dcf4327764481189f5
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r--src/vdbeapi.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c
index 94db205e1..e25acd944 100644
--- a/src/vdbeapi.c
+++ b/src/vdbeapi.c
@@ -71,17 +71,12 @@ int sqlite3_finalize(sqlite3_stmt *pStmt){
}else{
Vdbe *v = (Vdbe*)pStmt;
sqlite3 *db = v->db;
-#if SQLITE_THREADSAFE
- sqlite3_mutex *mutex;
-#endif
if( vdbeSafety(v) ) return SQLITE_MISUSE_BKPT;
-#if SQLITE_THREADSAFE
- mutex = v->db->mutex;
-#endif
- sqlite3_mutex_enter(mutex);
+ sqlite3_mutex_enter(db->mutex);
rc = sqlite3VdbeFinalize(v);
+ if( (rc&0xff)==SQLITE_MISUSE ) rc = SQLITE_OK;
rc = sqlite3ApiExit(db, rc);
- sqlite3_mutex_leave(mutex);
+ sqlite3LeaveMutexAndCloseZombie(db);
}
return rc;
}