summaryrefslogtreecommitdiff
path: root/protocols/MRA/Sdk/ListMT.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MRA/Sdk/ListMT.h')
-rw-r--r--protocols/MRA/Sdk/ListMT.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/protocols/MRA/Sdk/ListMT.h b/protocols/MRA/Sdk/ListMT.h
index d7ca6e0b12..38d9247488 100644
--- a/protocols/MRA/Sdk/ListMT.h
+++ b/protocols/MRA/Sdk/ListMT.h
@@ -126,18 +126,20 @@ __inline BOOL ListMTTryLock(PCLIST_MT pclmtListMT)
#endif
}
-
-__inline void ListMTLock(PCLIST_MT pclmtListMT)
+class mt_lock
{
- EnterCriticalSection(&pclmtListMT->cs);
-}
+ PCLIST_MT m_list;
+public:
+ __forceinline mt_lock(PCLIST_MT _pList) :
+ m_list( _pList )
+ { EnterCriticalSection(&_pList->cs);
+ }
-__inline void ListMTUnLock(PCLIST_MT pclmtListMT)
-{
- LeaveCriticalSection(&pclmtListMT->cs);
-}
-
+ __forceinline ~mt_lock()
+ { LeaveCriticalSection(&m_list->cs);
+ }
+};
__inline size_t ListMTGetCount(PCLIST_MT pclmtListMT)
{