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