1 //////////////////////////////////////////////////////////////////////////////
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)
7 // See http://www.boost.org/libs/interprocess for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #include <boost/interprocess/sync/named_recursive_mutex.hpp>
12 #include <boost/interprocess/sync/scoped_lock.hpp>
13 #include "mutex_test_template.hpp"
14 #include "named_creation_template.hpp"
15 #include "get_process_id_name.hpp"
18 #if defined(BOOST_INTERPROCESS_WINDOWS)
19 #include <boost/interprocess/sync/windows/named_recursive_mutex.hpp>
22 using namespace boost::interprocess
;
25 template<class NamedRecursiveMutex
>
26 int test_named_recursive_mutex()
30 NamedRecursiveMutex::remove(test::get_process_id_name());
31 test::test_named_creation
< test::named_sync_creation_test_wrapper
<NamedRecursiveMutex
> >();
32 #if defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES)
33 test::test_named_creation
< test::named_sync_creation_test_wrapper_w
<NamedRecursiveMutex
> >();
34 #endif //defined(BOOST_INTERPROCESS_WCHAR_NAMED_RESOURCES)
35 test::test_all_lock
< test::named_sync_wrapper
<NamedRecursiveMutex
> >();
36 test::test_all_mutex
<test::named_sync_wrapper
<NamedRecursiveMutex
> >();
37 test::test_all_recursive_lock
<test::named_sync_wrapper
<NamedRecursiveMutex
> >();
39 BOOST_CATCH(std::exception
&ex
){
40 std::cout
<< ex
.what() << std::endl
;
43 NamedRecursiveMutex::remove(test::get_process_id_name());
50 #if defined(BOOST_INTERPROCESS_WINDOWS)
51 ret
= test_named_recursive_mutex
<ipcdetail::winapi_named_recursive_mutex
>();
55 ret
= test_named_recursive_mutex
<named_recursive_mutex
>();