OpenZWave Library  1.4.3493
windows/MutexImpl.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 //
3 // MutexImpl.h
4 //
5 // Windows Implementation of the cross-platform mutex
6 //
7 // Copyright (c) 2010 Mal Lansell <mal@lansell.org>
8 // All rights reserved.
9 //
10 // SOFTWARE NOTICE AND LICENSE
11 //
12 // This file is part of OpenZWave.
13 //
14 // OpenZWave is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU Lesser General Public License as published
16 // by the Free Software Foundation, either version 3 of the License,
17 // or (at your option) any later version.
18 //
19 // OpenZWave is distributed in the hope that it will be useful,
20 // but WITHOUT ANY WARRANTY; without even the implied warranty of
21 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 // GNU Lesser General Public License for more details.
23 //
24 // You should have received a copy of the GNU Lesser General Public License
25 // along with OpenZWave. If not, see <http://www.gnu.org/licenses/>.
26 //
27 //-----------------------------------------------------------------------------
28 #ifndef _MutexImpl_H
29 #define _MutexImpl_H
30 
31 #include <windows.h>
32 
33 
34 namespace OpenZWave
35 {
38  class MutexImpl
39  {
40  private:
41  friend class Mutex;
42 
43  MutexImpl();
44  ~MutexImpl();
45 
46  bool Lock( bool const _bWait = true );
47  void Unlock();
48 
49  bool IsSignalled();
50 
51  CRITICAL_SECTION m_criticalSection;
52  uint32 m_lockCount; // Keep track of the locks (there can be more than one if they occur on the same thread.
53  };
54 
55 } // namespace OpenZWave
56 
57 #endif //_MutexIF_H
58 
Definition: Bitfield.h:34
Implements COMMAND_CLASS_LOCK (0x76), a Z-Wave device command class.
Definition: Lock.h:39
unsigned int uint32
Definition: Defs.h:80
Implements a platform-independent mutex–for serializing access to a shared resource.
Definition: Mutex.h:39
Windows-specific implementation of the Mutex class.
Definition: windows/MutexImpl.h:38