Revert "Removed unneeded sqlite3_threadsafe() check"
This reverts commit 2258c7bb73.
Conflicts:
c_src/sqlite3_drv.c
This commit is contained in:
@@ -422,6 +422,10 @@ static inline async_sqlite3_command *make_async_command_script(
|
|||||||
static inline void exec_async_command(
|
static inline void exec_async_command(
|
||||||
sqlite3_drv_t *drv, void (*async_invoke)(void*),
|
sqlite3_drv_t *drv, void (*async_invoke)(void*),
|
||||||
async_sqlite3_command *async_command) {
|
async_sqlite3_command *async_command) {
|
||||||
|
// Check is required because we are sometimes accessing
|
||||||
|
// sqlite3 from the emulator thread. Could also be fixed
|
||||||
|
// by making _all_ access except start/stop go through driver_async
|
||||||
|
if (sqlite3_threadsafe()) {
|
||||||
long status = driver_async(drv->port, &drv->key, async_invoke,
|
long status = driver_async(drv->port, &drv->key, async_invoke,
|
||||||
async_command, sql_free_async);
|
async_command, sql_free_async);
|
||||||
|
|
||||||
@@ -430,6 +434,10 @@ static inline void exec_async_command(
|
|||||||
LOG_ERROR("driver_async call failed", 0);
|
LOG_ERROR("driver_async call failed", 0);
|
||||||
output_error(drv, SQLITE_ERROR, "driver_async call failed");
|
output_error(drv, SQLITE_ERROR, "driver_async call failed");
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
async_invoke(async_command);
|
||||||
|
ready_async((ErlDrvData) drv, (ErlDrvThreadData) async_command);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int sql_exec_statement(
|
static inline int sql_exec_statement(
|
||||||
|
|||||||
Reference in New Issue
Block a user