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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
static inline int sql_exec_statement(
|
||||
|
||||
Reference in New Issue
Block a user