From 6f42eadc54e81be50b7a817c72b0cf4d7ec5feb4 Mon Sep 17 00:00:00 2001 From: iphydf Date: Fri, 2 Sep 2016 09:51:11 +0100 Subject: Replace pthread_yield with sched_yield. The former is a non-standard glibc extension. On linux, it is implemented as a call to sched_yield, so this change does nothing there. On OSX, pthread_yield doesn't exist, and we already use sched_yield. --- testing/av_test.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/testing/av_test.c b/testing/av_test.c index 2870e587..2c8281f4 100644 --- a/testing/av_test.c +++ b/testing/av_test.c @@ -22,7 +22,6 @@ * -lopencv_highgui -lopencv_imgproc -lsndfile -pthread -lvpx -lopus -lsodium -lportaudio */ - #include "../toxav/toxav.h" #include "../toxcore/network.h" /* current_time_monotonic() */ #include "../toxcore/tox.h" @@ -40,6 +39,7 @@ #include #include +#include #include #include #include @@ -47,13 +47,6 @@ #include #include -#ifdef __APPLE__ -#include -#define pthread_yield sched_yield -#else -#include -#endif - #define c_sleep(x) usleep(1000*x) @@ -660,7 +653,7 @@ CHECK_ARG: data.sig = -1; while (data.sig != 1) { - pthread_yield(); + sched_yield(); } pthread_mutex_destroy(AliceCC.arb_mutex); @@ -765,7 +758,7 @@ CHECK_ARG: data.sig = -1; while (data.sig != 1) { - pthread_yield(); + sched_yield(); } printf("Success!"); -- cgit v1.2.3