lock_options.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef BOOST_INTERPROCESS_LOCK_OPTIONS_HPP
  11. #define BOOST_INTERPROCESS_LOCK_OPTIONS_HPP
  12. #ifndef BOOST_CONFIG_HPP
  13. # include <boost/config.hpp>
  14. #endif
  15. #
  16. #if defined(BOOST_HAS_PRAGMA_ONCE)
  17. # pragma once
  18. #endif
  19. #include <boost/interprocess/detail/config_begin.hpp>
  20. #include <boost/interprocess/detail/workaround.hpp>
  21. //!\file
  22. //!Describes the lock options with associated with interprocess_mutex lock constructors.
  23. namespace boost {
  24. namespace interprocess {
  25. //!Type to indicate to a mutex lock constructor that must not lock the mutex.
  26. struct defer_lock_type{};
  27. //!Type to indicate to a mutex lock constructor that must try to lock the mutex.
  28. struct try_to_lock_type {};
  29. //!Type to indicate to a mutex lock constructor that the mutex is already locked.
  30. struct accept_ownership_type{};
  31. //!An object indicating that the locking
  32. //!must be deferred.
  33. static const defer_lock_type defer_lock = defer_lock_type();
  34. //!An object indicating that a try_lock()
  35. //!operation must be executed.
  36. static const try_to_lock_type try_to_lock = try_to_lock_type();
  37. //!An object indicating that the ownership of lockable
  38. //!object must be accepted by the new owner.
  39. static const accept_ownership_type accept_ownership = accept_ownership_type();
  40. } // namespace interprocess {
  41. } // namespace boost{
  42. #include <boost/interprocess/detail/config_end.hpp>
  43. #endif // BOOST_INTERPROCESS_LOCK_OPTIONS_HPP