From d8ae3fd3a6a4c15b1bb650c9bc9e6b5369c30912 Mon Sep 17 00:00:00 2001 From: John Emmas Date: Sat, 27 Jul 2019 12:31:15 +0100 Subject: [PATCH] MSVC requires an already initialized object to initialize our boost::detail::spinlock (rather than the simpler #define) Hopefully this'll work for the other builds too. --- libs/pbd/pbd/spinlock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/pbd/pbd/spinlock.h b/libs/pbd/pbd/spinlock.h index 41c40543f0..7173fde594 100644 --- a/libs/pbd/pbd/spinlock.h +++ b/libs/pbd/pbd/spinlock.h @@ -32,9 +32,11 @@ namespace PBD { * * initialize with BOOST_DETAIL_SPINLOCK_INIT */ +static boost::detail::spinlock sl_init = BOOST_DETAIL_SPINLOCK_INIT; + struct spinlock_t { public: - spinlock_t () : l (BOOST_DETAIL_SPINLOCK_INIT) {}; + spinlock_t () : l (sl_init) {}; void lock () { l.lock (); } void unlock () { l.unlock (); } bool try_lock () { return l.try_lock (); }