Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.


//          Copyright Oliver Kowalke 2013.
// Distributed under the Boost Software License, Version 1.0.
//    (See accompanying file LICENSE_1_0.txt or copy at
//  based on boost::interprocess::sync::interprocess_spin::mutex


#include <mutex>

#include <boost/fiber/detail/config.hpp>

namespace boost {
namespace fibers {
namespace detail {

struct non_spinlock {
    constexpr non_spinlock() noexcept {}
    void lock() noexcept {}
    void unlock() noexcept {}

struct non_lock {
    constexpr non_lock( non_spinlock) noexcept {}
    void lock() noexcept {}
    void unlock() noexcept {}

typedef std::mutex      spinlock;
using spinlock_lock = std::unique_lock< spinlock >;
typedef non_spinlock    spinlock;
using spinlock_lock = non_lock;