提交 2fae7089 authored 作者: Antonio's avatar Antonio 提交者: Mike Jerris

Revert "FS-10299 [mod_callcenter] Removing global lock on all cc_execute_sql…

Revert "FS-10299 [mod_callcenter] Removing global lock on all cc_execute_sql functions when executing database queries"

This reverts commit faf87feb.
上级 945710cc
...@@ -587,6 +587,8 @@ char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, ch ...@@ -587,6 +587,8 @@ char *cc_execute_sql2str(cc_queue_t *queue, switch_mutex_t *mutex, char *sql, ch
if (mutex) { if (mutex) {
switch_mutex_lock(mutex); switch_mutex_lock(mutex);
} else {
switch_mutex_lock(globals.mutex);
} }
if (!(dbh = cc_get_db_handle())) { if (!(dbh = cc_get_db_handle())) {
...@@ -601,6 +603,8 @@ end: ...@@ -601,6 +603,8 @@ end:
if (mutex) { if (mutex) {
switch_mutex_unlock(mutex); switch_mutex_unlock(mutex);
} else {
switch_mutex_unlock(globals.mutex);
} }
return ret; return ret;
...@@ -613,6 +617,8 @@ static switch_status_t cc_execute_sql(cc_queue_t *queue, char *sql, switch_mutex ...@@ -613,6 +617,8 @@ static switch_status_t cc_execute_sql(cc_queue_t *queue, char *sql, switch_mutex
if (mutex) { if (mutex) {
switch_mutex_lock(mutex); switch_mutex_lock(mutex);
} else {
switch_mutex_lock(globals.mutex);
} }
if (!(dbh = cc_get_db_handle())) { if (!(dbh = cc_get_db_handle())) {
...@@ -628,6 +634,8 @@ end: ...@@ -628,6 +634,8 @@ end:
if (mutex) { if (mutex) {
switch_mutex_unlock(mutex); switch_mutex_unlock(mutex);
} else {
switch_mutex_unlock(globals.mutex);
} }
return status; return status;
...@@ -641,6 +649,8 @@ static switch_bool_t cc_execute_sql_callback(cc_queue_t *queue, switch_mutex_t * ...@@ -641,6 +649,8 @@ static switch_bool_t cc_execute_sql_callback(cc_queue_t *queue, switch_mutex_t *
if (mutex) { if (mutex) {
switch_mutex_lock(mutex); switch_mutex_lock(mutex);
} else {
switch_mutex_lock(globals.mutex);
} }
if (!(dbh = cc_get_db_handle())) { if (!(dbh = cc_get_db_handle())) {
...@@ -661,6 +671,8 @@ end: ...@@ -661,6 +671,8 @@ end:
if (mutex) { if (mutex) {
switch_mutex_unlock(mutex); switch_mutex_unlock(mutex);
} else {
switch_mutex_unlock(globals.mutex);
} }
return ret; return ret;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论