]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow 100 microsecond tolerance on timer loop
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Mar 2011 18:50:42 +0000 (13:50 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Mar 2011 18:50:52 +0000 (13:50 -0500)
src/switch_core.c
src/switch_time.c

index 68186d9a07293d158cc0aa2f9323c524f8a3f84d..53f21dfb79bc27add13b8f835bf8ba0ac7ae585b 100644 (file)
@@ -1655,18 +1655,18 @@ static void switch_load_core_config(const char *file)
                                                switch_core_default_dtmf_duration((uint32_t) tmp);
                                        }
                                } else if (!strcasecmp(var, "enable-monotonic-timing")) {
-                                       switch_time_set_monotonic(switch_true(var));
+                                       switch_time_set_monotonic(switch_true(val));
                                } else if (!strcasecmp(var, "enable-softtimer-timerfd")) {
-                                       switch_time_set_timerfd(switch_true(var));
+                                       switch_time_set_timerfd(switch_true(val));
                                        if (switch_true(val)) {
                                                switch_clear_flag((&runtime), SCF_CALIBRATE_CLOCK);
                                        }
                                } else if (!strcasecmp(var, "enable-clock-nanosleep")) {
-                                       switch_time_set_nanosleep(switch_true(var));
+                                       switch_time_set_nanosleep(switch_true(val));
                                } else if (!strcasecmp(var, "enable-cond-yield")) {
-                                       switch_time_set_cond_yield(switch_true(var));
+                                       switch_time_set_cond_yield(switch_true(val));
                                } else if (!strcasecmp(var, "enable-timer-matrix")) {
-                                       switch_time_set_matrix(switch_true(var));
+                                       switch_time_set_matrix(switch_true(val));
                                } else if (!strcasecmp(var, "max-sessions") && !zstr(val)) {
                                        switch_core_session_limit(atoi(val));
                                } else if (!strcasecmp(var, "verbose-channel-events") && !zstr(val)) {
index 375682e0055baa99891fa06d62d8750b48985d9a..70972a660bd94b250dbaa20d471ee20293a410c1 100644 (file)
@@ -756,7 +756,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
 
        while (globals.RUNNING == 1) {
                runtime.reference += STEP_MIC;
-               while ((ts = time_now(runtime.offset)) < runtime.reference) {
+
+               while (((ts = time_now(runtime.offset)) + 100) < runtime.reference) {
                        if (ts < last) {
                                if (MONO) {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Virtual Migration Detected! Syncing Clock\n");
@@ -770,6 +771,10 @@ SWITCH_MODULE_RUNTIME_FUNCTION(softtimer_runtime)
                                        runtime.initiated += diff;
                                        rev_errs++;
                                }
+
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, 
+                                                                 "If you see this message many times try setting the param enable-clock-nanosleep to true in switch.conf.xml or consider a nicer machine to run me on. I AM *FREE* afterall.\n");
+
                        } else {
                                rev_errs = 0;
                        }