]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
move init sooner in timer module
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 11 Aug 2008 18:24:07 +0000 (18:24 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 11 Aug 2008 18:24:07 +0000 (18:24 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9241 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_time.c

index a0f8d4a73581b8360a28d1e48843d081870afdc1..1393b3072841e594764fb100b45a35bbdbca1f0d 100644 (file)
@@ -309,9 +309,6 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
 
        switch_time_sync();
 
-       memset(&globals, 0, sizeof(globals));
-       switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
-
        globals.STARTED = globals.RUNNING = 1;
        switch_mutex_lock(runtime.throttle_mutex);
        runtime.sps = runtime.sps_total;
@@ -430,6 +427,9 @@ SWITCH_MODULE_LOAD_FUNCTION(softtimer_load)
        switch_timer_interface_t *timer_interface;
        module_pool = pool;
 
+       memset(&globals, 0, sizeof(globals));
+       switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, module_pool);
+
        /* connect my internal structure to the blank pointer passed to me */
        *module_interface = switch_loadable_module_create_module_interface(pool, modname);
        timer_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_TIMER_INTERFACE);