fix monitor thread issue, even though commented out
[asterisk/asterisk.git] / channels / chan_mgcp.c
index a3efad5..38a5483 100755 (executable)
@@ -3043,7 +3043,7 @@ int unload_module()
                return -1;
        }
        if (!ast_mutex_lock(&monlock)) {
                return -1;
        }
        if (!ast_mutex_lock(&monlock)) {
-               if (monitor_thread) {
+               if (monitor_thread && (monitor_thread != -2)) {
                        pthread_cancel(monitor_thread);
                        pthread_kill(monitor_thread, SIGURG);
                        pthread_join(monitor_thread, NULL);
                        pthread_cancel(monitor_thread);
                        pthread_kill(monitor_thread, SIGURG);
                        pthread_join(monitor_thread, NULL);