]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[libvpx] Fix threading.
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 11 Sep 2019 15:52:35 +0000 (15:52 +0000)
committerAndrey Volk <andywolk@gmail.com>
Fri, 6 Mar 2020 17:14:26 +0000 (21:14 +0400)
libs/libvpx/vp8/common/threading.h

index 58b9013726946e94dc02fc23a46c8621b8e3e6b1..7a637cdff222fcf5d302e71bbec4515e8316ee15 100644 (file)
@@ -171,15 +171,11 @@ static inline int sem_destroy(sem_t *sem) {
 #define sem_wait(sem) (semaphore_wait(*sem))
 #define sem_post(sem) semaphore_signal(*sem)
 #define sem_destroy(sem) semaphore_destroy(mach_task_self(), *sem)
-#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
 #include <unistd.h>
 #include <sched.h>
-#define thread_sleep(nms) sched_yield();
-/* {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);}
 #endif
 /* Not Windows. Assume pthreads */
 
@@ -199,7 +195,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(1);
   }
 }