Commit 6ae12446 authored by Ghislain MARY's avatar Ghislain MARY

Use Sleep() function on Windows Phone 8.

parent 6429e5f5
......@@ -513,13 +513,9 @@ void ms_plugins_init(void) {
void ms_sleep(int seconds){
#ifdef WIN32
#if WINAPI_FAMILY_APP
HANDLE sleepEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
if (!sleepEvent)
return;
WaitForSingleObjectEx(sleepEvent, (seconds * 1000), FALSE);
#else
Sleep(seconds*1000);
void WINAPI Sleep(DWORD ms);
#endif
Sleep(seconds*1000);
#else
struct timespec ts,rem;
int err;
......@@ -535,13 +531,9 @@ void ms_sleep(int seconds){
void ms_usleep(uint64_t usec){
#ifdef WIN32
#if WINAPI_FAMILY_APP
HANDLE sleepEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
if (!sleepEvent)
return;
WaitForSingleObjectEx(sleepEvent, (usec / 1000), FALSE);
#else
Sleep((DWORD)(usec/1000));
void WINAPI Sleep(DWORD ms);
#endif
Sleep((DWORD)(usec/1000));
#else
struct timespec ts,rem;
int err;
......
......@@ -304,13 +304,9 @@ static uint64_t get_cur_time_ms(void *unused){
static void sleepMs(int ms){
#ifdef WIN32
#if WINAPI_FAMILY_APP
HANDLE sleepEvent = CreateEventEx(NULL, NULL, CREATE_EVENT_MANUAL_RESET, EVENT_ALL_ACCESS);
if (!sleepEvent)
return;
WaitForSingleObjectEx(sleepEvent, ms, FALSE);
#else
Sleep(ms);
void WINAPI Sleep(DWORD ms);
#endif
Sleep(ms);
#else
struct timespec ts;
ts.tv_sec=0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment