]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libvpx] add yield to vpx
authorAndrey Volk <andywolk@gmail.com>
Wed, 10 Aug 2022 22:21:04 +0000 (01:21 +0300)
committerAndrey Volk <andywolk@gmail.com>
Fri, 10 Jul 2026 16:38:46 +0000 (19:38 +0300)
libs/libvpx/vp8/common/threading.h

index 3cade4465d71ef177dc748c225d79bec39183717..ef2b701bdb1445ef732f21134038e37c88708f60 100644 (file)
@@ -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