windows: Provide a sched_yield() implementation

This commit is contained in:
Martin Willi
2014-06-04 15:53:01 +02:00
parent 5f35b73344
commit 266ee0a190
5 changed files with 10 additions and 3 deletions
+1
View File
@@ -36,6 +36,7 @@
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
# include <sched.h>
#endif
/**
+9
View File
@@ -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
*/