Removed unneeded sqlite3_threadsafe() check

Since the database is accessed from 1 thread only
thanks to `key` parameter of `driver_async`.
In fact we could previously potentially access the
same DB twice from different emulator threads
precisely when SQLite3 is compiled in single-thread
mode.
This commit is contained in:
Alexey Romanov
2014-10-17 22:34:09 +04:00
parent 87b88eb1c4
commit 2258c7bb73

View File

@@ -423,13 +423,8 @@ static inline async_sqlite3_command *make_async_command_script(
static inline void exec_async_command(
sqlite3_drv_t *drv, void (*async_invoke)(void*),
async_sqlite3_command *async_command) {
if (sqlite3_threadsafe()) {
drv->async_handle = driver_async(drv->port, &drv->key, async_invoke,
async_command, sql_free_async);
} else {
async_invoke(async_command);
ready_async((ErlDrvData) drv, (ErlDrvThreadData) async_command);
}
drv->async_handle = driver_async(drv->port, &drv->key, async_invoke,
async_command, sql_free_async);
}
static inline int sql_exec_statement(