lock_options.hpp 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
  25. namespace posix_time
  26. { class ptime; }
  27. #endif //#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
  28. namespace interprocess {
  29. //!Type to indicate to a mutex lock constructor that must not lock the mutex.
  30. struct defer_lock_type{};
  31. //!Type to indicate to a mutex lock constructor that must try to lock the mutex.
  32. struct try_to_lock_type {};
  33. //!Type to indicate to a mutex lock constructor that the mutex is already locked.
  34. struct accept_ownership_type{};
  35. //!An object indicating that the locking
  36. //!must be deferred.
  37. static const defer_lock_type defer_lock = defer_lock_type();
  38. //!An object indicating that a try_lock()
  39. //!operation must be executed.
  40. static const try_to_lock_type try_to_lock = try_to_lock_type();
  41. //!An object indicating that the ownership of lockable
  42. //!object must be accepted by the new owner.
  43. static const accept_ownership_type accept_ownership = accept_ownership_type();
  44. } // namespace interprocess {
  45. } // namespace boost{
  46. #include <boost/interprocess/detail/config_end.hpp>
  47. #endif // BOOST_INTERPROCESS_LOCK_OPTIONS_HPP