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:
parent
8a8468c5f1
commit
d8ae3fd3a6
@ -32,9 +32,11 @@ namespace PBD {
|
|||||||
*
|
*
|
||||||
* initialize with BOOST_DETAIL_SPINLOCK_INIT
|
* initialize with BOOST_DETAIL_SPINLOCK_INIT
|
||||||
*/
|
*/
|
||||||
|
static boost::detail::spinlock sl_init = BOOST_DETAIL_SPINLOCK_INIT;
|
||||||
|
|
||||||
struct spinlock_t {
|
struct spinlock_t {
|
||||||
public:
|
public:
|
||||||
spinlock_t () : l (BOOST_DETAIL_SPINLOCK_INIT) {};
|
spinlock_t () : l (sl_init) {};
|
||||||
void lock () { l.lock (); }
|
void lock () { l.lock (); }
|
||||||
void unlock () { l.unlock (); }
|
void unlock () { l.unlock (); }
|
||||||
bool try_lock () { return l.try_lock (); }
|
bool try_lock () { return l.try_lock (); }
|
||||||
|
Loading…
Reference in New Issue
Block a user