windows: Provide a sched_yield() implementation
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
# include <sys/socket.h>
|
||||
# include <netdb.h>
|
||||
# include <netinet/in.h>
|
||||
# include <sched.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,6 +67,15 @@ static inline void srandom(unsigned int seed)
|
||||
srand(seed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replacement of sched_yield(2) from <sched.h>
|
||||
*/
|
||||
static inline int sched_yield(void)
|
||||
{
|
||||
Sleep(0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* strdup(3), the Windows variant can't free(strdup("")) and others
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user