aboutsummaryrefslogtreecommitdiff
path: root/src/platform/windows/win_impl.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-07-07 18:41:56 -0700
committerGarrett D'Amore <garrett@damore.org>2017-07-07 18:41:56 -0700
commit3cedf14c3586b0770cb9ee62c75f922ab2006153 (patch)
tree2fd6422cd97f91330896a47ba5e68c20705f2c28 /src/platform/windows/win_impl.h
parent021d09af1375834fe9aaca916e60dcd2ad3be845 (diff)
downloadnng-3cedf14c3586b0770cb9ee62c75f922ab2006153.tar.gz
nng-3cedf14c3586b0770cb9ee62c75f922ab2006153.tar.bz2
nng-3cedf14c3586b0770cb9ee62c75f922ab2006153.zip
SRWLocks FTW!
Modern Windows (Vista and later) have light weight Slim Read/Write locks which only occupy 64 bits, and don't require any memory allocation to create. While here clean up a few more unreferenced variables found with the Microsoft compilers.
Diffstat (limited to 'src/platform/windows/win_impl.h')
-rw-r--r--src/platform/windows/win_impl.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/platform/windows/win_impl.h b/src/platform/windows/win_impl.h
index 85f73bf7..fd8f3f79 100644
--- a/src/platform/windows/win_impl.h
+++ b/src/platform/windows/win_impl.h
@@ -26,7 +26,7 @@
// These types are provided for here, to permit them to be directly inlined
// elsewhere.
-typedef struct nni_win_event nni_win_event;
+typedef struct nni_win_event nni_win_event;
// nni_win_event is used with io completion ports. This allows us to get
// to a specific completion callback without requiring the poller (in the
@@ -60,14 +60,14 @@ struct nni_plat_thr {
};
struct nni_plat_mtx {
- CRITICAL_SECTION cs;
- DWORD owner;
- int init;
+ SRWLOCK srl;
+ DWORD owner;
+ int init;
};
struct nni_plat_cv {
CONDITION_VARIABLE cv;
- CRITICAL_SECTION * cs;
+ PSRWLOCK srl;
};
extern int nni_win_error(int);