提交 ea754f52 authored 作者: Anthony Minessale's avatar Anthony Minessale

crank accuracy on windows sleep

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8269 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0874db56
...@@ -173,6 +173,9 @@ static switch_status_t timer_init(switch_timer_t *timer) ...@@ -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 ((private_info = switch_core_alloc(timer->memory_pool, sizeof(*private_info)))) {
#if defined(WIN32)
timeBeginPeriod(1);
#endif
switch_mutex_lock(globals.mutex); switch_mutex_lock(globals.mutex);
TIMER_MATRIX[timer->interval].count++; TIMER_MATRIX[timer->interval].count++;
switch_mutex_unlock(globals.mutex); switch_mutex_unlock(globals.mutex);
...@@ -454,6 +457,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(softtimer_shutdown) ...@@ -454,6 +457,12 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(softtimer_shutdown)
switch_yield(10000); switch_yield(10000);
} }
} }
#if defined(WIN32)
timeEndPeriod(1);
#endif
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论