File indexing completed on 2025-01-18 09:30:26
0001
0002 #ifndef BOOST_CONTRACT_DETAIL_INLINED_DETAIL_CHECKING_HPP_
0003 #define BOOST_CONTRACT_DETAIL_INLINED_DETAIL_CHECKING_HPP_
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include <boost/contract/detail/checking.hpp>
0014 #include <boost/contract/detail/declspec.hpp>
0015 #include <boost/thread/lock_guard.hpp>
0016
0017 namespace boost { namespace contract { namespace detail {
0018
0019 BOOST_CONTRACT_DETAIL_DECLINLINE
0020 void checking::init_unlocked() { flag::ref() = true; }
0021
0022 BOOST_CONTRACT_DETAIL_DECLINLINE
0023 void checking::init_locked() {
0024 boost::lock_guard<boost::mutex> lock(mutex::ref());
0025 init_unlocked();
0026 }
0027
0028 BOOST_CONTRACT_DETAIL_DECLINLINE
0029 void checking::done_unlocked() { flag::ref() = false; }
0030
0031 BOOST_CONTRACT_DETAIL_DECLINLINE
0032 void checking::done_locked() {
0033 boost::lock_guard<boost::mutex> lock(mutex::ref());
0034 done_unlocked();
0035 }
0036
0037 BOOST_CONTRACT_DETAIL_DECLINLINE
0038 bool checking::already_unlocked() { return flag::ref(); }
0039
0040 BOOST_CONTRACT_DETAIL_DECLINLINE
0041 bool checking::already_locked() {
0042 boost::lock_guard<boost::mutex> lock(mutex::ref());
0043 return already_unlocked();
0044 }
0045
0046 } } }
0047
0048 #endif
0049