diff options
author | Robin Gareus <robin@gareus.org> | 2019-09-26 02:47:16 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-09-26 02:48:17 +0200 |
commit | 5395a557d23cb99fc5c63176ca76d478404279aa (patch) | |
tree | 07a0c1b2f8c31861dc82e3150d67c2ac89ab76c4 /libs/pbd/pbd/spinlock.h | |
parent | 8ab5db0d6710b1a4eb58ea732ec9222173b1f33f (diff) |
Another try at C++11/boost spinlock initialization
Diffstat (limited to 'libs/pbd/pbd/spinlock.h')
-rw-r--r-- | libs/pbd/pbd/spinlock.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libs/pbd/pbd/spinlock.h b/libs/pbd/pbd/spinlock.h index 44bc6c299b..3f4336ec56 100644 --- a/libs/pbd/pbd/spinlock.h +++ b/libs/pbd/pbd/spinlock.h @@ -41,7 +41,7 @@ public: /* C++11 non-static data member initialization, * with non-copyable std::atomic ATOMIC_FLAG_INIT */ - spinlock_t () : l {BOOST_DETAIL_SPINLOCK_INIT} {}; + spinlock_t () {} #else /* default C++ assign struct's first member */ spinlock_t () @@ -55,7 +55,11 @@ public: bool try_lock () { return l.try_lock (); } private: +#ifdef BOOST_SMART_PTR_DETAIL_SPINLOCK_STD_ATOMIC_HPP_INCLUDED + boost::detail::spinlock l = BOOST_DETAIL_SPINLOCK_INIT; +#else boost::detail::spinlock l; +#endif /* prevent copy construction */ spinlock_t (const spinlock_t&); |