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:
parent
0874db56f7
commit
ea754f52bd
|
@ -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)
|
||||||
switch_yield(10000);
|
switch_yield(10000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
timeEndPeriod(1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
return SWITCH_STATUS_SUCCESS;
|
return SWITCH_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue