]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
new version of vp8 thread sleep patch
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 17 Jan 2019 20:21:29 +0000 (20:21 +0000)
committerAndrey Volk <andywolk@gmail.com>
Thu, 25 Jul 2019 19:06:17 +0000 (23:06 +0400)
libs/libvpx/vp8/common/threading.h

index b082bf109e413da4f2e88c8de970a479c6eae728..c89cf9bad746e229d7f88407a5165d8e02a23a3e 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);
   }
 }