author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Tue, 09 Dec 2014 13:17:49 -0800 | |
changeset 11097 | caafe12b0378 |
parent 7386 | 2310ed220a61 |
permissions | -rw-r--r-- |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
2 |
/* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
4 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
8 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
13 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
17 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage.inria.fr> |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
19 |
*/ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
20 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
21 |
#ifndef SYSTEM_MUTEX_H |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
22 |
#define SYSTEM_MUTEX_H |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
23 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
24 |
#include "ptr.h" |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
25 |
|
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
26 |
/** |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
27 |
* @file |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
28 |
* @ingroup thread |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
29 |
* System-independent mutex primitive, ns3::SystemMutex, |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
30 |
* and ns3::CriticalSection. |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
31 |
*/ |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
32 |
|
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
33 |
namespace ns3 { |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
34 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
35 |
class SystemMutexPrivate; |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
36 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
37 |
/** |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
38 |
* @ingroup thread |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
39 |
* @brief A class which provides a relatively platform-independent Mutual |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
40 |
* Exclusion thread synchronization primitive. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
41 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
42 |
* When more than one thread needs to access a shared resource (data structure |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
43 |
* or device), the system needs to provide a way to serialize access to the |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
44 |
* resource. An operating system will typically provide a Mutual Exclusion |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
45 |
* primitive to provide that capability. We provide plattorm-independent |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
46 |
* access to the OS-dependent capability with the SystemMutex class. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
47 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
48 |
* There are two operations: Lock and Unlock. Lock allows an executing |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
49 |
* SystemThread to attempt to acquire ownership of the Mutual Exclusion |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
50 |
* object. If the SystemMutex object is not owned by another thread, then |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
51 |
* ownership is granted to the calling SystemThread and Lock returns |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
52 |
* immediately, However, if the SystemMutex is already owned by another |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
53 |
* SystemThread, the calling SystemThread is blocked until the current owner |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
54 |
* releases the SystemMutex by calling Unlock. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
55 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
56 |
* @see CriticalSection |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
57 |
*/ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
58 |
class SystemMutex |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
59 |
{ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
60 |
public: |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
61 |
SystemMutex (); |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
62 |
~SystemMutex (); |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
63 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
64 |
/** |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
65 |
* Acquire ownership of the Mutual Exclusion object. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
66 |
*/ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
67 |
void Lock (); |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
68 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
69 |
/** |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
70 |
* Release ownership of the Mutual Exclusion object. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
71 |
*/ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
72 |
void Unlock (); |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
73 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
74 |
private: |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
75 |
/** The (system-dependent) implementation. */ |
7169
358f71a624d8
core coding style changes
Josh Pelkey <jpelkey@gatech.edu>
parents:
6821
diff
changeset
|
76 |
SystemMutexPrivate * m_priv; |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
77 |
}; |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
78 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
79 |
/** |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
80 |
* @brief A class which provides a simple way to implement a Critical Section. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
81 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
82 |
* When more than one SystemThread needs to access a shared resource, we |
6273
8d70de29d514
spell check, mostly in comments.
Andrey Mazo <mazo@iitp.ru>
parents:
3425
diff
changeset
|
83 |
* control access by acquiring a SystemMutex. The CriticalSection class uses |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
84 |
* the C++ scoping rules to automatically perform the required Lock and Unlock |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
85 |
* operations on the shared SystemMutex to implement a Critical Section. |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
86 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
87 |
* If one wants to treat an entire method call as a critical section, one would |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
88 |
* do something like, |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
89 |
* @code |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
90 |
* Class::Method () |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
91 |
* { |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
92 |
* CriticalSection cs (mutex); |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
93 |
* ... |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
94 |
* } |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
95 |
* @endcode |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
96 |
* In this case, the critical section is entered when the CriticalSection |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
97 |
* object is created, and the critical section is exited when the |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
98 |
* CriticalSection object goes out of scope at the end of the method. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
99 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
100 |
* Finer granularity is achieved by using local scope blocks. |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
101 |
* @code |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
102 |
* Class::Method () |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
103 |
* { |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
104 |
* ... |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
105 |
* { |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
106 |
* CriticalSection cs (mutex); |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
107 |
* } |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
108 |
* ... |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
109 |
* } |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
110 |
* @endcode |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
111 |
* Here, the critical section is entered partway through the method when the |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
112 |
* CriticalSection object is created in the local scope block (the braces). |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
113 |
* The critical section is exited when the CriticalSection object goes out of |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
114 |
* scope at the end of block. |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
115 |
* |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
116 |
* @see SystemMutex |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
117 |
*/ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
118 |
class CriticalSection |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
119 |
{ |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
120 |
public: |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
121 |
/** |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
122 |
* Construct with the required SystemMutex. |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
123 |
* |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
124 |
* @param [in] mutex The mutex. |
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
125 |
*/ |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
126 |
CriticalSection (SystemMutex &mutex); |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
127 |
/** Destructor */ |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
128 |
~CriticalSection (); |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
129 |
private: |
11097
caafe12b0378
[Doxygen] OS functions: filesystem, threading, wall clock.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7386
diff
changeset
|
130 |
SystemMutex &m_mutex; /**< The mutex. */ |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
131 |
}; |
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
132 |
|
7386
2310ed220a61
standardize ns-3 namespace declaration format
Vedran Miletić <rivanvx@gmail.com>
parents:
7169
diff
changeset
|
133 |
} // namespace ns3 |
3425
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
134 |
|
c69779f5e51e
add system threads and synchronization primitives
Craig Dowell <craigdo@ee.washington.edu>
parents:
diff
changeset
|
135 |
#endif /* SYSTEM_MUTEX_H */ |