[libvpx] add yield to vpx

This commit is contained in:
Anthony Minessale 2020-03-19 03:08:33 +00:00 committed by Mike Jerris
parent 56478e0248
commit 6837661658
2 changed files with 3 additions and 3 deletions

View File

@ -1 +1 @@
Wed Feb 27 11:26:31 MST 2019
Thu Mar 19 03:08:11 UTC 2020

View File

@ -171,11 +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;sched_yield();nanosleep(&ts, NULL);}
#else
#include <unistd.h>
#include <sched.h>
#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
/* Not Windows. Assume pthreads */