Chris@16: /* Chris@101: * Copyright Andrey Semashev 2007 - 2015. Chris@16: * Distributed under the Boost Software License, Version 1.0. Chris@16: * (See accompanying file LICENSE_1_0.txt or copy at Chris@16: * http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: /*! Chris@16: * \file fake_mutex.hpp Chris@16: * \author Andrey Semashev Chris@16: * \date 31.07.2011 Chris@16: * Chris@16: * \brief This header is the Boost.Log library implementation, see the library documentation Chris@16: * at http://www.boost.org/doc/libs/release/libs/log/doc/html/index.html. Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_LOG_DETAIL_FAKE_MUTEX_HPP_INCLUDED_ Chris@16: #define BOOST_LOG_DETAIL_FAKE_MUTEX_HPP_INCLUDED_ Chris@16: Chris@16: #include Chris@16: #include Chris@16: Chris@16: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@16: #pragma once Chris@16: #endif Chris@16: Chris@16: namespace boost { Chris@16: Chris@16: BOOST_LOG_OPEN_NAMESPACE Chris@16: Chris@16: namespace aux { Chris@16: Chris@16: //! Fake mutex that doesn't do anything. Note: we're not using \c null_mutex from Boost.Thread in order not to introduce false dependencies on Boost.Thread and Boost.Chrono. Chris@16: class fake_mutex Chris@16: { Chris@16: public: Chris@16: BOOST_DEFAULTED_FUNCTION(fake_mutex(), {}) Chris@16: void lock() {} Chris@16: bool try_lock() { return true; } Chris@16: template< typename T > Chris@16: bool timed_lock(T const&) { return true; } Chris@16: void unlock() {} Chris@16: Chris@16: // Copying prohibited Chris@16: BOOST_DELETED_FUNCTION(fake_mutex(fake_mutex const&)) Chris@16: BOOST_DELETED_FUNCTION(fake_mutex& operator=(fake_mutex const&)) Chris@16: }; Chris@16: Chris@16: } // namespace aux Chris@16: Chris@16: BOOST_LOG_CLOSE_NAMESPACE // namespace log Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #include Chris@16: Chris@16: #endif // BOOST_LOG_DETAIL_FAKE_MUTEX_HPP_INCLUDED_