提交 8ea3e3c7 authored 作者: Italo Rossi's avatar Italo Rossi

Merge pull request #1313 in FS/freeswitch from…

Merge pull request #1313 in FS/freeswitch from ~ANTONIO/freeswitch:bugfix/FS-10368-mod_callcenter-lock-database-errors to master

* commit '04854fdd':
  Revert "FS-10299 [mod_callcenter] Removing global lock on all cc_execute_sql functions when executing database queries"
......@@ -601,6 +601,8 @@ char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, ch
if (mutex) {
switch_mutex_lock(mutex);
} else {
switch_mutex_lock(globals.mutex);
}
if (!(dbh = cc_get_db_handle())) {
......@@ -615,6 +617,8 @@ end:
if (mutex) {
switch_mutex_unlock(mutex);
} else {
switch_mutex_unlock(globals.mutex);
}
return ret;
......@@ -627,6 +631,8 @@ static switch_status_t cc_execute_sql(cc_queue_t *queue, char *sql, switch_mutex
if (mutex) {
switch_mutex_lock(mutex);
} else {
switch_mutex_lock(globals.mutex);
}
if (!(dbh = cc_get_db_handle())) {
......@@ -642,6 +648,8 @@ end:
if (mutex) {
switch_mutex_unlock(mutex);
} else {
switch_mutex_unlock(globals.mutex);
}
return status;
......@@ -655,6 +663,8 @@ static switch_bool_t cc_execute_sql_callback(cc_queue_t *queue, switch_mutex_t *
if (mutex) {
switch_mutex_lock(mutex);
} else {
switch_mutex_lock(globals.mutex);
}
if (!(dbh = cc_get_db_handle())) {
......@@ -675,6 +685,8 @@ end:
if (mutex) {
switch_mutex_unlock(mutex);
} else {
switch_mutex_unlock(globals.mutex);
}
return ret;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论