1 ////////////////////////////////////////////////////////////////////////////// 2 // 3 // (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost 4 // Software License, Version 1.0. (See accompanying file 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 6 // 7 // See http://www.boost.org/libs/interprocess for documentation. 8 // 9 ////////////////////////////////////////////////////////////////////////////// 10 11 #ifndef BOOST_INTERPROCESS_LOCK_OPTIONS_HPP 12 #define BOOST_INTERPROCESS_LOCK_OPTIONS_HPP 13 14 #ifndef BOOST_CONFIG_HPP 15 # include <boost/config.hpp> 16 #endif 17 # 18 #if defined(BOOST_HAS_PRAGMA_ONCE) 19 # pragma once 20 #endif 21 22 #include <boost/interprocess/detail/config_begin.hpp> 23 #include <boost/interprocess/detail/workaround.hpp> 24 25 //!\file 26 //!Describes the lock options with associated with interprocess_mutex lock constructors. 27 28 namespace boost { 29 30 #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) 31 32 namespace posix_time 33 { class ptime; } 34 35 #endif //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED) 36 37 namespace interprocess { 38 39 //!Type to indicate to a mutex lock constructor that must not lock the mutex. 40 struct defer_lock_type{}; 41 //!Type to indicate to a mutex lock constructor that must try to lock the mutex. 42 struct try_to_lock_type {}; 43 //!Type to indicate to a mutex lock constructor that the mutex is already locked. 44 struct accept_ownership_type{}; 45 46 //!An object indicating that the locking 47 //!must be deferred. 48 static const defer_lock_type defer_lock = defer_lock_type(); 49 50 //!An object indicating that a try_lock() 51 //!operation must be executed. 52 static const try_to_lock_type try_to_lock = try_to_lock_type(); 53 54 //!An object indicating that the ownership of lockable 55 //!object must be accepted by the new owner. 56 static const accept_ownership_type accept_ownership = accept_ownership_type(); 57 58 } // namespace interprocess { 59 } // namespace boost{ 60 61 #include <boost/interprocess/detail/config_end.hpp> 62 63 #endif // BOOST_INTERPROCESS_LOCK_OPTIONS_HPP 64