forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmutexImpl.h
More file actions
70 lines (51 loc) · 1.7 KB
/
mutexImpl.h
File metadata and controls
70 lines (51 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Filename: mutexImpl.h
// Created by: drose (08Aug02)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
#ifndef MUTEXIMPL_H
#define MUTEXIMPL_H
#include "dtoolbase.h"
#include "selectThreadImpl.h"
#if defined(THREAD_DUMMY_IMPL)||defined(THREAD_SIMPLE_IMPL)
#include "mutexDummyImpl.h"
typedef MutexDummyImpl MutexImpl;
typedef MutexDummyImpl ReMutexImpl;
#define HAVE_REMUTEXIMPL 1
#elif defined(MUTEX_SPINLOCK)
#include "mutexSpinlockImpl.h"
typedef MutexSpinlockImpl MutexImpl;
#undef HAVE_REMUTEXIMPL
#elif defined(THREAD_WIN32_IMPL)
#include "mutexWin32Impl.h"
typedef MutexWin32Impl MutexImpl;
typedef MutexWin32Impl ReMutexImpl; // Win32 Mutexes are always reentrant.
#define HAVE_REMUTEXIMPL 1
#elif defined(THREAD_POSIX_IMPL)
#include "mutexPosixImpl.h"
typedef MutexPosixImpl MutexImpl;
typedef ReMutexPosixImpl ReMutexImpl;
#define HAVE_REMUTEXIMPL 1
#endif
// Also define what a true OS-provided lock will be, even if we don't
// have threading enabled in the build. Sometimes we need to
// interface with an external program or something that wants real
// locks.
#if defined(WIN32_VC)
#include "mutexWin32Impl.h"
typedef MutexWin32Impl TrueMutexImpl;
#elif defined(HAVE_POSIX_THREADS)
#include "mutexPosixImpl.h"
typedef MutexPosixImpl TrueMutexImpl;
#else
// No true threads, sorry. Better not try to use 'em.
#endif
#endif