Panda3D
Loading...
Searching...
No Matches
mutexWin32Impl.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file mutexWin32Impl.h
10 * @author drose
11 * @date 2006-02-07
12 */
13
14#ifndef MUTEXWIN32IMPL_H
15#define MUTEXWIN32IMPL_H
16
17#include "dtoolbase.h"
18#include "selectThreadImpl.h"
19
20#ifdef _WIN32
21#ifndef WIN32_LEAN_AND_MEAN
22#define WIN32_LEAN_AND_MEAN 1
23#endif
24#include <windows.h>
25
26/**
27 * Uses Windows native calls to implement a mutex.
28 */
29class EXPCL_DTOOL_DTOOLBASE MutexWin32Impl {
30public:
31 MutexWin32Impl();
32 MutexWin32Impl(const MutexWin32Impl &copy) = delete;
33 INLINE ~MutexWin32Impl();
34
35 MutexWin32Impl &operator = (const MutexWin32Impl &copy) = delete;
36
37public:
38 INLINE void lock();
39 INLINE bool try_lock();
40 INLINE void unlock();
41
42private:
43 CRITICAL_SECTION _lock;
44 friend class ConditionVarWin32Impl;
45 friend class ConditionVarFullWin32Impl;
46};
47
48#include "mutexWin32Impl.I"
49
50#endif // _WIN32
51
52#endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.