]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
windows: Add a sleep function acting as cancellation point
authorMartin Willi <martin@revosec.ch>
Mon, 21 Oct 2013 14:58:54 +0000 (16:58 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 4 Jun 2014 13:53:01 +0000 (15:53 +0200)
src/libstrongswan/utils/windows.h

index 83a6d6253ba43b91e209a08feb16b3c92cbf23e4..afa52424239ff358bf3f4f7f187712d9bfa207c2 100644 (file)
@@ -76,6 +76,15 @@ static inline int sched_yield(void)
        return 0;
 }
 
+/**
+ * Replacement of sleep(3), cancellable by thread_cancel()
+ */
+static inline int sleep(unsigned int seconds)
+{
+       SleepEx(seconds * 1000, TRUE);
+       return 0;
+}
+
 /**
  * strdup(3), the Windows variant can't free(strdup("")) and others
  */