mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 00:04:53 +00:00
Merge "res_config_pgsql: Release table locks where appropriate" into 13
This commit is contained in:
@@ -768,6 +768,7 @@ static int update_pgsql(const char *database, const char *tablename, const char
|
|||||||
ast_mutex_lock(&pgsql_lock);
|
ast_mutex_lock(&pgsql_lock);
|
||||||
if (!pgsql_reconnect(database)) {
|
if (!pgsql_reconnect(database)) {
|
||||||
ast_mutex_unlock(&pgsql_lock);
|
ast_mutex_unlock(&pgsql_lock);
|
||||||
|
release_table(table);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -913,6 +914,7 @@ static int update2_pgsql(const char *database, const char *tablename, const stru
|
|||||||
ast_mutex_lock(&pgsql_lock);
|
ast_mutex_lock(&pgsql_lock);
|
||||||
if (!pgsql_reconnect(database)) {
|
if (!pgsql_reconnect(database)) {
|
||||||
ast_mutex_unlock(&pgsql_lock);
|
ast_mutex_unlock(&pgsql_lock);
|
||||||
|
release_table(table);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1357,6 +1359,7 @@ static int require_pgsql(const char *database, const char *tablename, va_list ap
|
|||||||
|
|
||||||
if (pgsql_exec(database, tablename, ast_str_buffer(sql), &result) != 0) {
|
if (pgsql_exec(database, tablename, ast_str_buffer(sql), &result) != 0) {
|
||||||
ast_mutex_unlock(&pgsql_lock);
|
ast_mutex_unlock(&pgsql_lock);
|
||||||
|
release_table(table);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user