]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/fiber/include/boost/fiber/detail/spinlock.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / fiber / include / boost / fiber / detail / spinlock.hpp
CommitLineData
7c673cae
FG
1
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)
6//
7// based on boost::interprocess::sync::interprocess_spin::mutex
8
9#ifndef BOOST_FIBERS_SPINLOCK_H
10#define BOOST_FIBERS_SPINLOCK_H
11
12#include <mutex>
13
14#include <boost/fiber/detail/config.hpp>
15
16namespace boost {
17namespace fibers {
18namespace detail {
19
20struct non_spinlock {
21 constexpr non_spinlock() noexcept {}
22 void lock() noexcept {}
23 void unlock() noexcept {}
24};
25
26struct non_lock {
27 constexpr non_lock( non_spinlock) noexcept {}
28 void lock() noexcept {}
29 void unlock() noexcept {}
30};
31
32#if ! defined(BOOST_FIBERS_NO_ATOMICS)
33typedef std::mutex spinlock;
34using spinlock_lock = std::unique_lock< spinlock >;
35#else
36typedef non_spinlock spinlock;
37using spinlock_lock = non_lock;
38#endif
39
40}}}
41
42#endif // BOOST_FIBERS_SPINLOCK_H