Ecore : ecore_thread: use Sleep() on Windows, instead of usleep()
authorVincent Torri <vincent.torri@gmail.com>
Tue, 17 May 2011 07:17:53 +0000 (07:17 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Tue, 17 May 2011 07:17:53 +0000 (07:17 +0000)
usleep() does not exists on Windows. Use Sleep() instead. But the
resolution timers are not good on Windows. the sleep will be around
50ms at best.

SVN revision: 59466

legacy/ecore/src/lib/ecore/ecore_thread.c

index 717b14e..8932e75 100644 (file)
@@ -677,7 +677,11 @@ _ecore_thread_worker(Ecore_Pthread_Data *pth)
    LKU(_ecore_pending_job_threads_mutex);
 
    /* Sleep a little to prevent premature death */
+#ifdef _WIN32
+   Sleep(1); /* around 50ms */
+#else
    usleep(200);
+#endif
 
    LKL(_ecore_pending_job_threads_mutex);
    if (_ecore_pending_job_threads || _ecore_pending_job_threads_feedback)