mutex_timeout_test.cpp 1.0 KB

123456789101112131415161718192021222324252627282930
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2004-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. // enable timeout feature
  11. #define BOOST_INTERPROCESS_ENABLE_TIMEOUT_WHEN_LOCKING
  12. #define BOOST_INTERPROCESS_TIMEOUT_WHEN_LOCKING_DURATION_MS 1000
  13. #include <boost/assert.hpp>
  14. #include <boost/interprocess/detail/config_begin.hpp>
  15. #include <boost/interprocess/sync/interprocess_mutex.hpp>
  16. #include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
  17. #include "mutex_test_template.hpp"
  18. int main ()
  19. {
  20. using namespace boost::interprocess;
  21. test::test_mutex_lock_timeout<interprocess_mutex>();
  22. test::test_mutex_lock_timeout<interprocess_recursive_mutex>();
  23. return 0;
  24. }
  25. #include <boost/interprocess/detail/config_end.hpp>