2 // Copyright Oliver Kowalke 2013.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
7 // based on boost::interprocess::sync::interprocess_spin::mutex
9 #ifndef BOOST_FIBERS_SPINLOCK_H
10 #define BOOST_FIBERS_SPINLOCK_H
14 #include <boost/fiber/detail/config.hpp>
21 constexpr non_spinlock() noexcept {}
22 void lock() noexcept {}
23 void unlock() noexcept {}
27 constexpr non_lock( non_spinlock) noexcept {}
28 void lock() noexcept {}
29 void unlock() noexcept {}
32 #if ! defined(BOOST_FIBERS_NO_ATOMICS)
33 typedef std::mutex spinlock;
34 using spinlock_lock = std::unique_lock< spinlock >;
36 typedef non_spinlock spinlock;
37 using spinlock_lock = non_lock;
42 #endif // BOOST_FIBERS_SPINLOCK_H