]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/contract/detail/inlined/detail/checking.hpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / boost / contract / detail / inlined / detail / checking.hpp
1
2 #ifndef BOOST_CONTRACT_DETAIL_INLINED_DETAIL_CHECKING_HPP_
3 #define BOOST_CONTRACT_DETAIL_INLINED_DETAIL_CHECKING_HPP_
4
5 // Copyright (C) 2008-2018 Lorenzo Caminiti
6 // Distributed under the Boost Software License, Version 1.0 (see accompanying
7 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
8 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
9
10 // IMPORTANT: Do NOT use config macros BOOST_CONTRACT_... in this file so lib
11 // .cpp does not need recompiling if config changes (recompile only user code).
12
13 #include <boost/contract/detail/checking.hpp>
14 #include <boost/contract/detail/declspec.hpp>
15 #include <boost/thread/lock_guard.hpp>
16
17 namespace boost { namespace contract { namespace detail {
18
19 BOOST_CONTRACT_DETAIL_DECLINLINE
20 void checking::init_unlocked() { flag::ref() = true; }
21
22 BOOST_CONTRACT_DETAIL_DECLINLINE
23 void checking::init_locked() {
24 boost::lock_guard<boost::mutex> lock(mutex::ref());
25 init_unlocked();
26 }
27
28 BOOST_CONTRACT_DETAIL_DECLINLINE
29 void checking::done_unlocked() { flag::ref() = false; }
30
31 BOOST_CONTRACT_DETAIL_DECLINLINE
32 void checking::done_locked() {
33 boost::lock_guard<boost::mutex> lock(mutex::ref());
34 done_unlocked();
35 }
36
37 BOOST_CONTRACT_DETAIL_DECLINLINE
38 bool checking::already_unlocked() { return flag::ref(); }
39
40 BOOST_CONTRACT_DETAIL_DECLINLINE
41 bool checking::already_locked() {
42 boost::lock_guard<boost::mutex> lock(mutex::ref());
43 return already_unlocked();
44 }
45
46 } } } // namespace
47
48 #endif
49