mirror of
https://github.com/robotn/gohook.git
synced 2025-01-18 13:46:41 +08:00
Merge pull request #13 from zeropool/patch-2
sched_yield support for non-POSIX windows gcc
This commit is contained in:
commit
198a589461
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user