mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
Another try at fixing our 'spinlock_t' compatibility
This commit is contained in:
parent
82bdb48dab
commit
bf5da033dc
2 changed files with 16 additions and 22 deletions
|
|
@ -16,31 +16,10 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
#include <windows.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "pbd/spinlock.h"
|
||||
|
||||
using namespace PBD;
|
||||
|
||||
spinlock_t::spinlock_t ()
|
||||
#ifdef BOOST_SMART_PTR_DETAIL_SPINLOCK_STD_ATOMIC_HPP_INCLUDED
|
||||
/* C++11 non-static data member initialization,
|
||||
* with non-copyable std::atomic ATOMIC_FLAG_INIT
|
||||
*/
|
||||
: l {BOOST_DETAIL_SPINLOCK_INIT} {}
|
||||
#else
|
||||
/* default C++ assign struct's first member */
|
||||
{
|
||||
boost::detail::spinlock init = BOOST_DETAIL_SPINLOCK_INIT;
|
||||
std::memcpy (&l, &init, sizeof (init));
|
||||
}
|
||||
#endif
|
||||
|
||||
SpinLock::SpinLock (spinlock_t& lock)
|
||||
: _lock (lock)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue