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

Fix YIELD definitions.

parent 0907149b
No related branches found
No related tags found
No related merge requests found
......@@ -175,7 +175,7 @@ extern "C" {
#elif defined(__unix__)
#ifndef SLEEP
#ifndef SBBS
#ifndef YIELD
#define YIELD()
#endif
#define SLEEP(x) ({ int y=x; struct timeval tv; \
......
......@@ -49,18 +49,21 @@ extern "C" {
#include <sys/param.h>
#include <pthread.h> /* POSIX threads and mutexes */
#ifdef __linux__
#define YIELD() sched_yield()
#else
#define YIELD() pthread_yield()
#endif
#if defined(_NEED_SEM)
#include "sem.h"
#else
#include <semaphore.h> /* POSIX semaphores */
#endif
ulong _beginthread(void( *start_address )( void * )
,unsigned stack_size, void *arglist);
#undef YIELD
#if defined(__linux__)
#define YIELD() sched_yield()
#elif defined(_PTH_PTHREAD_H_)
#define YIELD() pth_yield(NULL)
#else
#define YIELD() pthread_yield()
#endif
#if defined(_NEED_SEM)
#include "sem.h"
#else
#include <semaphore.h> /* POSIX semaphores */
#endif
ulong _beginthread(void( *start_address )( void * )
,unsigned stack_size, void *arglist);
#elif defined(_WIN32)
......@@ -127,7 +130,6 @@ extern "C" {
#define SLEEP(x) ({ int y=x; struct timeval tv; \
tv.tv_sec=(y/1000); tv.tv_usec=((y%1000)*1000); \
pth_nap(tv); })
#define YIELD() pth_yield(NULL)
#endif
#endif /* Don't add anything after this line */
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