]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
crank accuracy on windows sleep
authorAnthony Minessale <anthony.minessale@gmail.com>
Tue, 6 May 2008 13:58:36 +0000 (13:58 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Tue, 6 May 2008 13:58:36 +0000 (13:58 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8269 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_time.c

index e60289deb2279aa13812ae0feeb5295525df6ef2..b57b0fe80b498adcce21c02bd2d15b643e396456 100644 (file)
@@ -173,6 +173,9 @@ static switch_status_t timer_init(switch_timer_t *timer)
        }
 
        if ((private_info = switch_core_alloc(timer->memory_pool, sizeof(*private_info)))) {
+#if defined(WIN32)
+               timeBeginPeriod(1);
+#endif
                switch_mutex_lock(globals.mutex);
                TIMER_MATRIX[timer->interval].count++;
                switch_mutex_unlock(globals.mutex);
@@ -454,6 +457,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(softtimer_shutdown)
                        switch_yield(10000);
                }
        }
+
+#if defined(WIN32)
+       timeEndPeriod(1);
+#endif
+
+
        return SWITCH_STATUS_SUCCESS;
 }