mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
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.
This commit is contained in:
parent
579bdc126f
commit
6f42eadc54
|
@ -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 <assert.h>
|
||||
#include <errno.h>
|
||||
#include <sched.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -47,13 +47,6 @@
|
|||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <sched.h>
|
||||
#define pthread_yield sched_yield
|
||||
#else
|
||||
#include <pthread.h>
|
||||
#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!");
|
||||
|
|
Loading…
Reference in New Issue
Block a user