summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd/spinlock.h
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2019-07-28 15:01:40 +0200
committerRobin Gareus <robin@gareus.org>2019-07-28 15:01:40 +0200
commitd00650c2fdbee486c456143b9e2f1cb00485f4ad (patch)
treea83264305bdc2c38b0357ff910211831e529480b /libs/pbd/pbd/spinlock.h
parentd382b756c2e832bbb8a5778d704c8310ad19ad57 (diff)
Another attempt at improving spinlock init
Diffstat (limited to 'libs/pbd/pbd/spinlock.h')
-rw-r--r--libs/pbd/pbd/spinlock.h11
1 files changed, 1 insertions, 10 deletions
diff --git a/libs/pbd/pbd/spinlock.h b/libs/pbd/pbd/spinlock.h
index 69b76ce820..6fafeb0f78 100644
--- a/libs/pbd/pbd/spinlock.h
+++ b/libs/pbd/pbd/spinlock.h
@@ -32,17 +32,10 @@ namespace PBD {
*
* initialize with BOOST_DETAIL_SPINLOCK_INIT
*/
-#ifdef COMPILER_MSVC
-private:
- static boost::detail::spinlock sl_init = BOOST_DETAIL_SPINLOCK_INIT;
-# define SPINLOCK_INIT sl_init
-#else
-# define SPINLOCK_INIT BOOST_DETAIL_SPINLOCK_INIT
-#endif
struct spinlock_t {
public:
- spinlock_t () : l (SPINLOCK_INIT) {};
+ spinlock_t ();
void lock () { l.lock (); }
void unlock () { l.unlock (); }
bool try_lock () { return l.try_lock (); }
@@ -50,8 +43,6 @@ private:
boost::detail::spinlock l;
};
-#undef SPINLOCK_INIT
-
/* RAII wrapper */
class LIBPBD_API SpinLock {