]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add switch_yield for windows
authorMichael Jerris <mike@jerris.com>
Sun, 17 Sep 2006 22:40:19 +0000 (22:40 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 17 Sep 2006 22:40:19 +0000 (22:40 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2729 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_utils.h

index d8b9774af0fb0aa7109f0b9ad207c076667f54de..02cb144507de0016a5f4df1c8ed179632c3209b8 100644 (file)
@@ -166,10 +166,12 @@ switch_mutex_unlock(obj->flag_mutex);
 /*!
   \brief Wait a desired number of microseconds and yield the CPU
 */
-#ifdef HAVE_USLEEP
+#if defined(HAVE_USLEEP)
 #define switch_yield(ms) usleep(ms);
+#elif defined(WIN32)
+#define switch_yield(ms) Sleep((DWORD)((ms) / 1000));
 #else
-#define switch_yield(ms) apr_sleep((ms) * 10); //apr_thread_yield();
+#define switch_yield(ms) apr_sleep(ms); //apr_thread_yield();
 #endif
 
 /*!