From 97ceaf43b2dea5a54b567f5727e069c64742f9e7 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Thu, 11 Aug 2022 01:19:09 +0300 Subject: [PATCH] [libvpx] Fix threading. --- libs/libvpx/vp8/common/threading.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libs/libvpx/vp8/common/threading.h b/libs/libvpx/vp8/common/threading.h index 1cfb9fec51..3cade4465d 100644 --- a/libs/libvpx/vp8/common/threading.h +++ b/libs/libvpx/vp8/common/threading.h @@ -179,11 +179,9 @@ static inline int sem_destroy(sem_t *sem) { /* thread_sleep implementation: yield unless Linux/Unix. */ #if defined(__unix__) || defined(__APPLE__) -#define thread_sleep(nms) -/* {struct timespec ts;ts.tv_sec=0; - ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} */ +#define thread_sleep(nms) {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} #else -#define thread_sleep(nms) sched_yield(); +#define thread_sleep(nms) {struct timespec ts;ts.tv_sec=0; ts.tv_nsec = 1000*nms;nanosleep(&ts, NULL);} #endif /* __unix__ || __APPLE__ */ #endif @@ -202,7 +200,7 @@ static INLINE void vp8_atomic_spin_wait( const int nsync) { while (mb_col > (vpx_atomic_load_acquire(last_row_current_mb_col) - nsync)) { x86_pause_hint(); - thread_sleep(0); + thread_sleep(1000); } }