13
0

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.
This commit is contained in:
John Emmas 2019-07-27 12:31:15 +01:00
parent 8a8468c5f1
commit d8ae3fd3a6

View File

@ -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 (); }