diff --git a/chan/eb_chan.h b/chan/eb_chan.h index e4855b4..72189e1 100644 --- a/chan/eb_chan.h +++ b/chan/eb_chan.h @@ -30,6 +30,13 @@ #include +#if (defined(__MINGW32__) || defined(__CYGWIN__)) && !defined(_POSIX_PRIORITY_SCHEDULING) +#include +int sched_yield() { + return SwitchToThread(); +} +#endif + typedef uint64_t eb_nsec; /* Units of nanoseconds */ #define eb_nsec_zero UINT64_C(0) #define eb_nsec_forever UINT64_MAX @@ -1436,4 +1443,4 @@ eb_chan_op *eb_chan_select_list(eb_nsec timeout, eb_chan_op *const ops[], size_t return result; } -#endif /* EB_CHAN_H */ \ No newline at end of file +#endif /* EB_CHAN_H */