aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/threads.h
diff options
context:
space:
mode:
authorAnderson Toshiyuki Sasaki <ansasaki@redhat.com>2018-07-02 14:01:46 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-03 16:43:03 +0200
commit04cc7b769a359ca2afdcfc0b70b5e8a17849b556 (patch)
tree67253fced38cd8d1abed2a3aff54a3d638dea3c7 /include/libssh/threads.h
parent83b43443e51b5db06184750fb874e1e8d7ece95a (diff)
downloadlibssh-04cc7b769a359ca2afdcfc0b70b5e8a17849b556.tar.gz
libssh-04cc7b769a359ca2afdcfc0b70b5e8a17849b556.tar.xz
libssh-04cc7b769a359ca2afdcfc0b70b5e8a17849b556.zip
threads: Add Windows threads implementation
Added Windows threads implementation based on CriticalSection. Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'include/libssh/threads.h')
-rw-r--r--include/libssh/threads.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/libssh/threads.h b/include/libssh/threads.h
index 750793b2..e8ccf7be 100644
--- a/include/libssh/threads.h
+++ b/include/libssh/threads.h
@@ -35,6 +35,13 @@
#define SSH_MUTEX_STATIC_INIT PTHREAD_MUTEX_INITIALIZER
#endif
+#elif (defined _WIN32) || (defined _WIN64)
+
+#include <windows.h>
+#include <winbase.h>
+#define SSH_MUTEX CRITICAL_SECTION *
+#define SSH_MUTEX_STATIC_INIT NULL
+
#else
# define SSH_MUTEX void *