mirror of
https://github.com/robotn/gohook.git
synced 2025-01-18 13:46:41 +08:00
sched_yield support for non-POSIX windows gcc
This commit is contained in:
parent
185bc1badc
commit
8c52dfa009
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user