mirror of
https://github.com/coturn/coturn.git
synced 2025-10-27 13:00:59 +01:00
Change sqlite_init_multithreaded return type to void
to satisfy pthread_once() interface because previously return from sqlite_init_multithreaded was not used
This commit is contained in:
parent
2d12ad4f29
commit
0f7ff3ec4a
@ -95,7 +95,7 @@ static void sqlite_unlock(int write)
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
static int sqlite_init_multithreaded(void) {
|
||||
static void sqlite_init_multithreaded(void) {
|
||||
|
||||
#if defined(SQLITE_CONFIG_MULTITHREAD)
|
||||
if (sqlite3_threadsafe() > 0) {
|
||||
@ -104,16 +104,14 @@ static int sqlite_init_multithreaded(void) {
|
||||
retCode = sqlite3_config(SQLITE_CONFIG_SERIALIZED);
|
||||
if (retCode != SQLITE_OK) {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "setting sqlite thread safe mode to serialized failed!!! return code: %d\n", retCode);
|
||||
return -1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "Your SQLite database is not compiled to be threadsafe.\n");
|
||||
return -1;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int donot_print_connection_success = 0;
|
||||
@ -179,7 +177,7 @@ static sqlite3 * get_sqlite_connection(void) {
|
||||
sqlite3 *sqliteconnection = (sqlite3 *)pthread_getspecific(connection_key);
|
||||
if(!sqliteconnection) {
|
||||
fix_user_directory(pud->userdb);
|
||||
(void) pthread_once(&sqlite_init_once, (void (*)(void))sqlite_init_multithreaded);
|
||||
(void) pthread_once(&sqlite_init_once, sqlite_init_multithreaded);
|
||||
int rc = sqlite3_open(pud->userdb, &sqliteconnection);
|
||||
if(!sqliteconnection || (rc != SQLITE_OK)) {
|
||||
const char* errmsg = sqlite3_errmsg(sqliteconnection);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user