]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
windows: Provide a sched_yield() implementation
authorMartin Willi <martin@revosec.ch>
Wed, 23 Oct 2013 14:44:14 +0000 (16:44 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:01 +0000 (15:53 +0200)
src/libstrongswan/credentials/sets/cert_cache.c
src/libstrongswan/tests/suites/test_threading.c
src/libstrongswan/tests/suites/test_watcher.c
src/libstrongswan/utils/utils.h
src/libstrongswan/utils/windows.h

index e8f0e7ec06686f5f8a074d142bcb3bba705e3ebb..563f4bdd56259afc491f25b0d6b04e6d3694352e 100644 (file)
@@ -16,7 +16,6 @@
 #include "cert_cache.h"
 
 #include <time.h>
-#include <sched.h>
 
 #include <library.h>
 #include <threading/rwlock.h>
index 496310c8cadd2c51ba41c7ecb9308c5ecb75b50d..0526d9d6e11a0c91d35c77f34d574e8a4fcd1e0b 100644 (file)
@@ -16,7 +16,6 @@
 
 #include "test_suite.h"
 
-#include <sched.h>
 #include <unistd.h>
 
 #include <threading/thread.h>
index 451fa0b384f2d18a34523beea3eed003862c7829..11b4c3a7d243a2e8b748b2acb96ff24c1b43b5cc 100644 (file)
@@ -17,7 +17,6 @@
 
 #include <library.h>
 
-#include <sched.h>
 #include <unistd.h>
 #include <errno.h>
 
index c14b9c11e0cd6d6ead062f5b8b76bbb85e9f74ef..ced47a4b80b12fb199182fdc465444bfb86b9f3f 100644 (file)
@@ -36,6 +36,7 @@
 # include <sys/socket.h>
 # include <netdb.h>
 # include <netinet/in.h>
+# include <sched.h>
 #endif
 
 /**
index 90c92fd60a3bf3da646c0cb87dbdb7e4d4ac190a..83a6d6253ba43b91e209a08feb16b3c92cbf23e4 100644 (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
  */