Back to home page

EIC code displayed by LXR

 
 

    


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 // Copyright (C) 2008-2018 Lorenzo Caminiti
0006 // Distributed under the Boost Software License, Version 1.0 (see accompanying
0007 // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
0008 // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
0009 
0010 // IMPORTANT: Do NOT use config macros BOOST_CONTRACT_... in this file so lib
0011 // .cpp does not need recompiling if config changes (recompile only user code).
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 } } } // namespace
0047 
0048 #endif
0049