提交 3d447565 authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-9106 add new version of previous vpx sleep patch

上级 8bd56deb
...@@ -166,11 +166,11 @@ static inline int sem_destroy(sem_t * sem) ...@@ -166,11 +166,11 @@ static inline int sem_destroy(sem_t * sem)
#define sem_wait(sem) (semaphore_wait(*sem) ) #define sem_wait(sem) (semaphore_wait(*sem) )
#define sem_post(sem) semaphore_signal(*sem) #define sem_post(sem) semaphore_signal(*sem)
#define sem_destroy(sem) semaphore_destroy(mach_task_self(),*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 #else
#include <unistd.h> #include <unistd.h>
#include <sched.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 #endif
/* Not Windows. Assume pthreads */ /* Not Windows. Assume pthreads */
...@@ -213,7 +213,7 @@ static INLINE void sync_read(pthread_mutex_t *const mutex, int mb_col, ...@@ -213,7 +213,7 @@ static INLINE void sync_read(pthread_mutex_t *const mutex, int mb_col,
const int nsync) { const int nsync) {
while (mb_col > (protected_read(mutex, last_row_current_mb_col) - nsync)) { while (mb_col > (protected_read(mutex, last_row_current_mb_col) - nsync)) {
x86_pause_hint(); x86_pause_hint();
thread_sleep(0); thread_sleep(1);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论