aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2013-10-21 16:58:54 +0200
committerMartin Willi <martin@revosec.ch>2014-06-04 15:53:01 +0200
commit986a577097f8aeb5b5dda16a5c148e3fa02aba4a (patch)
tree8850c4429583feac19806dd543eb29e52aaf90c0 /src
parent266ee0a190beb026335a9f51b25edf721825b609 (diff)
downloadstrongswan-986a577097f8aeb5b5dda16a5c148e3fa02aba4a.tar.bz2
strongswan-986a577097f8aeb5b5dda16a5c148e3fa02aba4a.tar.xz
windows: Add a sleep function acting as cancellation point
Diffstat (limited to 'src')
-rw-r--r--src/libstrongswan/utils/windows.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstrongswan/utils/windows.h b/src/libstrongswan/utils/windows.h
index 83a6d6253..afa524242 100644
--- a/src/libstrongswan/utils/windows.h
+++ b/src/libstrongswan/utils/windows.h
@@ -77,6 +77,15 @@ static inline int sched_yield(void)
}
/**
+ * 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
*/
#define strdup strdup_windows