From: Martin Willi Date: Mon, 21 Oct 2013 14:58:54 +0000 (+0200) Subject: windows: Add a sleep function acting as cancellation point X-Git-Tag: 5.2.0dr6~24^2~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=986a577097f8aeb5b5dda16a5c148e3fa02aba4a;p=thirdparty%2Fstrongswan.git windows: Add a sleep function acting as cancellation point --- diff --git a/src/libstrongswan/utils/windows.h b/src/libstrongswan/utils/windows.h index 83a6d6253b..afa5242423 100644 --- a/src/libstrongswan/utils/windows.h +++ b/src/libstrongswan/utils/windows.h @@ -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 */