nx_server_plugin_sdk 1.0 Server Plugin SDK

mutex.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 class MutexImpl;
6
8
11 class Mutex
12 {
13 public:
14 class ScopedLock
15 {
16 public:
17 ScopedLock( Mutex* mtx )
18 :
19 m_mtx( mtx )
20 {
21 m_mtx->lock();
22 }
23 ~ScopedLock()
24 {
25 m_mtx->unlock();
26 }
27
28 private:
29 Mutex* m_mtx;
30 };
31
32 Mutex();
33 ~Mutex();
34
35 private:
36 MutexImpl* m_impl;
37
38 void lock();
39 void unlock();
40 };
Mutex
Non-recursive non-named mutex.
Definition: mutex.h:11
Mutex::ScopedLock
Definition: mutex.h:14
MutexImpl
Definition: mutex.cpp:12