@@ -50,8 +50,7 @@ class Exception; // Needed for catch
50
50
51
51
#ifdef WIN_NT
52
52
53
- // Generic process-local mutex and spinlock. The latter
54
- // is used to manage memory heaps in a threaded environment.
53
+ // Generic process-local mutex.
55
54
56
55
// Windows version of the class
57
56
@@ -151,23 +150,6 @@ class Mutex : public Reasons
151
150
Mutex& operator =(const Mutex&);
152
151
};
153
152
154
- class Spinlock : public Mutex
155
- {
156
- private:
157
- void init ();
158
-
159
- public:
160
- Spinlock ()
161
- {
162
- init ();
163
- }
164
-
165
- explicit Spinlock (MemoryPool&)
166
- {
167
- init ();
168
- }
169
- };
170
-
171
153
#else // WIN_NT
172
154
173
155
// Pthreads version of the class
@@ -272,51 +254,6 @@ friend class Condition;
272
254
Mutex& operator =(const Mutex&);
273
255
};
274
256
275
- #ifdef NOT_USED_OR_REPLACED // we do not use spinlocks currently
276
- class Spinlock
277
- {
278
- private:
279
- pthread_spinlock_t spinlock;
280
- public:
281
- Spinlock ()
282
- {
283
- if (pthread_spin_init (&spinlock, false ))
284
- system_call_failed::raise (" pthread_spin_init" );
285
- }
286
-
287
- explicit Spinlock (MemoryPool&)
288
- {
289
- if (pthread_spin_init (&spinlock, false ))
290
- system_call_failed::raise (" pthread_spin_init" );
291
- }
292
-
293
- ~Spinlock ()
294
- {
295
- if (pthread_spin_destroy (&spinlock))
296
- system_call_failed::raise (" pthread_spin_destroy" );
297
- }
298
-
299
- void enter ()
300
- {
301
- if (pthread_spin_lock (&spinlock))
302
- system_call_failed::raise (" pthread_spin_lock" );
303
- }
304
-
305
- void leave ()
306
- {
307
- if (pthread_spin_unlock (&spinlock))
308
- system_call_failed::raise (" pthread_spin_unlock" );
309
- }
310
-
311
- private:
312
- // Forbid copying
313
- Spinlock (const Spinlock&);
314
- Spinlock& operator =(const Spinlock&);
315
- };
316
- #else
317
- typedef Mutex Spinlock;
318
- #endif
319
-
320
257
#endif // WIN_NT
321
258
322
259
0 commit comments