From: Andrey Volk Date: Wed, 10 Aug 2022 22:21:04 +0000 (+0300) Subject: [libvpx] add yield to vpx X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e5cacd76442f4743f13729623c0c3e9d0fe291ca;p=thirdparty%2Ffreeswitch.git [libvpx] add yield to vpx --- diff --git a/libs/libvpx/vp8/common/threading.h b/libs/libvpx/vp8/common/threading.h index 3cade4465d..ef2b701bdb 100644 --- a/libs/libvpx/vp8/common/threading.h +++ b/libs/libvpx/vp8/common/threading.h @@ -179,9 +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;sched_yield();nanosleep(&ts, NULL);} #else -#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;sched_yield();clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL);} #endif /* __unix__ || __APPLE__ */ #endif