summaryrefslogtreecommitdiff
path: root/vpx_util/vpx_thread.h
diff options
context:
space:
mode:
Diffstat (limited to 'vpx_util/vpx_thread.h')
-rw-r--r--vpx_util/vpx_thread.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/vpx_util/vpx_thread.h b/vpx_util/vpx_thread.h
index 4c20f378b..26de0de9f 100644
--- a/vpx_util/vpx_thread.h
+++ b/vpx_util/vpx_thread.h
@@ -211,6 +211,17 @@ static INLINE int pthread_cond_wait(pthread_cond_t *const condition,
#endif
return !ok;
}
+
+static INLINE int sched_yield() {
+ int ok = 0;
+#if _WIN32_WINNT >= 0x0400 // Windows XP and above
+ SwitchToThread();
+#else
+ Sleep(0);
+#endif // _WIN32_WINNT >= 0x0400
+ return ok;
+}
+
#elif defined(__OS2__)
#define INCL_DOS
#include <os2.h> // NOLINT