13
0

Yet another spinlock init hack for g++8 std::atomics

Perhaps we should rather implement this ourselves,
using <boost/atomic.hpp>
This commit is contained in:
Robin Gareus 2019-07-28 18:37:57 +02:00
parent 63fee3b0c8
commit 684b364a8a
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -21,13 +21,16 @@
#include <malloc.h>
#endif
#include <cstring>
#include "pbd/spinlock.h"
using namespace PBD;
spinlock_t::spinlock_t ()
{
l = BOOST_DETAIL_SPINLOCK_INIT;
boost::detail::spinlock init = BOOST_DETAIL_SPINLOCK_INIT;
std::memcpy (&l, &init, sizeof (init));
}
SpinLock::SpinLock (spinlock_t& lock)