Panda3D
mutexImpl.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 mutexImpl.h
10  * @author drose
11  * @date 2002-08-08
12  */
13 
14 #ifndef MUTEXIMPL_H
15 #define MUTEXIMPL_H
16 
17 #include "dtoolbase.h"
18 #include "selectThreadImpl.h"
19 
20 #if defined(THREAD_DUMMY_IMPL)||defined(THREAD_SIMPLE_IMPL)
21 
22 #include "mutexDummyImpl.h"
25 #define HAVE_REMUTEXIMPL 1
26 
27 #elif defined(MUTEX_SPINLOCK)
28 
29 #include "mutexSpinlockImpl.h"
30 typedef MutexSpinlockImpl MutexImpl;
31 #undef HAVE_REMUTEXIMPL
32 
33 #elif defined(THREAD_WIN32_IMPL)
34 
35 #include "mutexWin32Impl.h"
36 typedef MutexWin32Impl MutexImpl;
37 typedef MutexWin32Impl ReMutexImpl; // Win32 Mutexes are always reentrant.
38 #define HAVE_REMUTEXIMPL 1
39 
40 #elif defined(THREAD_POSIX_IMPL)
41 
42 #include "mutexPosixImpl.h"
43 typedef MutexPosixImpl MutexImpl;
44 typedef ReMutexPosixImpl ReMutexImpl;
45 #define HAVE_REMUTEXIMPL 1
46 
47 #endif
48 
49 // Also define what a true OS-provided lock will be, even if we don't have
50 // threading enabled in the build. Sometimes we need to interface with an
51 // external program or something that wants real locks.
52 #if defined(WIN32_VC)
53 #include "mutexWin32Impl.h"
54 typedef MutexWin32Impl TrueMutexImpl;
55 
56 #elif defined(HAVE_POSIX_THREADS)
57 #include "mutexPosixImpl.h"
58 typedef MutexPosixImpl TrueMutexImpl;
59 
60 #else
61 // No true threads, sorry. Better not try to use 'em.
62 
63 #endif
64 
65 #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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A fake mutex implementation for single-threaded applications that don't need any synchronization cont...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.