From 3cedf14c3586b0770cb9ee62c75f922ab2006153 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 7 Jul 2017 18:41:56 -0700 Subject: 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. --- src/platform/windows/win_impl.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/platform/windows/win_impl.h') 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); -- cgit v1.2.3-70-g09d2