Merge pull request #13 from zeropool/patch-2

sched_yield support for non-POSIX windows gcc
This commit is contained in:
vz 2020-05-20 10:50:49 -04:00 committed by GitHub
commit 198a589461
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,6 +30,13 @@
#include <stdint.h>
#if (defined(__MINGW32__) || defined(__CYGWIN__)) && !defined(_POSIX_PRIORITY_SCHEDULING)
#include <windows.h>
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 */
#endif /* EB_CHAN_H */