]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_callcenter: Possible fix on unload module freeze when an member uuid changed...
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Fri, 22 Apr 2011 05:42:47 +0000 (01:42 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Fri, 22 Apr 2011 05:42:47 +0000 (01:42 -0400)
src/mod/applications/mod_callcenter/mod_callcenter.c

index 0810abb49b66105d288fb5d8c0d55d4b30e61bf6..e363fa8fd11acf3717e06e1f98d2991a248e7d88 100644 (file)
@@ -2205,10 +2205,6 @@ void *SWITCH_THREAD_FUNC cc_member_thread_run(switch_thread_t *thread, void *obj
        switch_core_session_t *member_session = switch_core_session_locate(m->member_session_uuid);
        switch_channel_t *member_channel = NULL;
 
-       switch_mutex_lock(globals.mutex);
-       globals.threads++;
-       switch_mutex_unlock(globals.mutex);
-
        if (member_session) {
                member_channel = switch_core_session_get_channel(member_session);
        } else {
@@ -2216,6 +2212,10 @@ void *SWITCH_THREAD_FUNC cc_member_thread_run(switch_thread_t *thread, void *obj
                return NULL;
        }
 
+       switch_mutex_lock(globals.mutex);
+       globals.threads++;
+       switch_mutex_unlock(globals.mutex);
+
        while(switch_channel_ready(member_channel) && m->running && globals.running) {
                cc_queue_t *queue = NULL;