]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10299 [mod_callcenter] Removing global lock on all cc_execute_sql functions when...
authorItalo Rossi <italorossib@gmail.com>
Tue, 9 May 2017 14:44:30 +0000 (11:44 -0300)
committerMike Jerris <mike@jerris.com>
Thu, 1 Jun 2017 20:13:43 +0000 (16:13 -0400)
src/mod/applications/mod_callcenter/mod_callcenter.c

index c08618362d1fafb2eef1037918ff3733947020ea..682534ff91ea029e77a82beb23b532771de62446 100644 (file)
@@ -587,8 +587,6 @@ 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())) {
@@ -603,8 +601,6 @@ end:
 
        if (mutex) {
                switch_mutex_unlock(mutex);
-       } else {
-               switch_mutex_unlock(globals.mutex);
        }
 
        return ret;
@@ -617,8 +613,6 @@ 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())) {
@@ -634,8 +628,6 @@ end:
 
        if (mutex) {
                switch_mutex_unlock(mutex);
-       } else {
-               switch_mutex_unlock(globals.mutex);
        }
 
        return status;
@@ -649,8 +641,6 @@ 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())) {
@@ -671,8 +661,6 @@ end:
 
        if (mutex) {
                switch_mutex_unlock(mutex);
-       } else {
-               switch_mutex_unlock(globals.mutex);
        }
 
        return ret;