@@ -53,16 +53,16 @@ class Semaphore
53
53
HANDLE hSemaphore;
54
54
void init ();
55
55
56
- // Forbid copying (there is no definition of these methods)
57
- Semaphore (const Semaphore&);
58
- Semaphore& operator =(const Semaphore&);
59
-
60
56
public:
61
57
Semaphore () { init (); }
62
58
explicit Semaphore (MemoryPool&) { init (); }
63
59
64
60
~Semaphore ();
65
61
62
+ // Forbid copying
63
+ Semaphore (const Semaphore&) = delete ;
64
+ Semaphore& operator =(const Semaphore&) = delete ;
65
+
66
66
#define CLASSES_SEMAPHORE_H_HAS_TRYENTER 1
67
67
bool tryEnter (const int seconds = 0 , int milliseconds = 0 );
68
68
@@ -96,16 +96,16 @@ class SignalSafeSemaphore
96
96
97
97
void init ();
98
98
99
- // Forbid copying
100
- SignalSafeSemaphore (const SignalSafeSemaphore&);
101
- SignalSafeSemaphore& operator =(const SignalSafeSemaphore&);
102
-
103
99
public:
104
100
SignalSafeSemaphore () { init (); }
105
101
explicit SignalSafeSemaphore (MemoryPool&) { init (); }
106
102
107
103
~SignalSafeSemaphore ();
108
104
105
+ // Forbid copying
106
+ SignalSafeSemaphore (const SignalSafeSemaphore&) = delete ;
107
+ SignalSafeSemaphore& operator =(const SignalSafeSemaphore&) = delete ;
108
+
109
109
void enter ()
110
110
{
111
111
dispatch_semaphore_wait (semaphore, DISPATCH_TIME_FOREVER);
@@ -148,15 +148,16 @@ class SignalSafeSemaphore
148
148
149
149
void init ();
150
150
151
- // Forbid copying
152
- SignalSafeSemaphore (const SignalSafeSemaphore&);
153
- SignalSafeSemaphore& operator =(const SignalSafeSemaphore&);
154
-
155
151
public:
156
152
SignalSafeSemaphore () { init (); }
157
153
explicit SignalSafeSemaphore (MemoryPool&) { init (); }
158
154
159
155
~SignalSafeSemaphore ();
156
+
157
+ // Forbid copying
158
+ SignalSafeSemaphore (const SignalSafeSemaphore&) = delete ;
159
+ SignalSafeSemaphore& operator =(const SignalSafeSemaphore&) = delete ;
160
+
160
161
void enter ();
161
162
162
163
void release (SLONG count = 1 )
@@ -218,16 +219,16 @@ class Semaphore
218
219
void mtxLock ();
219
220
void mtxUnlock ();
220
221
221
- // Forbid copying
222
- Semaphore (const Semaphore&);
223
- Semaphore& operator =(const Semaphore&);
224
-
225
222
public:
226
223
Semaphore () { init (); }
227
224
explicit Semaphore (MemoryPool&) { init (); }
228
225
229
226
~Semaphore ();
230
227
228
+ // Forbid copying
229
+ Semaphore (const Semaphore&) = delete ;
230
+ Semaphore& operator =(const Semaphore&) = delete ;
231
+
231
232
bool tryEnter (const int seconds = 0 , int milliseconds = 0 );
232
233
void enter ();
233
234
void release (SLONG count = 1 );
0 commit comments