@@ -50,8 +50,7 @@ class Exception; // Needed for catch
5050
5151#ifdef WIN_NT
5252
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.
5554
5655// Windows version of the class
5756
@@ -151,23 +150,6 @@ class Mutex : public Reasons
151150 Mutex& operator =(const Mutex&);
152151};
153152
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-
171153#else // WIN_NT
172154
173155// Pthreads version of the class
@@ -272,51 +254,6 @@ friend class Condition;
272254 Mutex& operator =(const Mutex&);
273255};
274256
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-
320257#endif // WIN_NT
321258
322259
0 commit comments