crank accuracy on windows sleep

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8269 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-05-06 13:58:36 +00:00
parent 0874db56f7
commit ea754f52bd
1 changed files with 9 additions and 0 deletions

View 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;
}