Skip to content
Snippets Groups Projects
Commit f4970104 authored by deuce's avatar deuce
Browse files

pthread_wait sched_wait

Linux		    No		    Yes
FreeBSD		    Yes		    Yes
OpenBSD		    No		    No
NetBSD		  Yes(lib)	    No
QNX		    No		    Yes

*sigh*
parent ef1d601f
No related branches found
No related tags found
No related merge requests found
......@@ -177,7 +177,11 @@ extern "C" {
#ifndef SLEEP
#ifndef YIELD
#define YIELD() sched_yield()
#if defined(__OpenBSD__) || defined(__NetBSD__)
#define YIELD()
#else
#define YIELD() sched_yield()
#endif
#endif
#define SLEEP(x) ({ int y=x; struct timeval tv; \
tv.tv_sec=(y/1000); tv.tv_usec=((y%1000)*1000); \
......
......@@ -50,7 +50,7 @@ extern "C" {
#include <sys/param.h>
#include <pthread.h> /* POSIX threads and mutexes */
#undef YIELD
#if defined(__linux__)
#if defined(__linux__) || defined(__QNX__)
#define YIELD() sched_yield()
#elif defined(_PTH_PTHREAD_H_)
#define YIELD() pth_yield(NULL)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment