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 11 #include <boost/interprocess/sync/named_recursive_mutex.hpp> 12 #include <boost/interprocess/sync/scoped_lock.hpp> 13 #include <boost/date_time/posix_time/posix_time_types.hpp> 14 #include "mutex_test_template.hpp" 15 #include "named_creation_template.hpp" 16 #include <string> 17 #include "get_process_id_name.hpp" 18 19 using namespace boost::interprocess; 20 main()21int main () 22 { 23 try{ 24 named_recursive_mutex::remove(test::get_process_id_name()); 25 test::test_named_creation< test::named_sync_creation_test_wrapper<named_recursive_mutex> >(); 26 test::test_all_lock< test::named_sync_wrapper<named_recursive_mutex> >(); 27 test::test_all_mutex<test::named_sync_wrapper<named_recursive_mutex> >(); 28 test::test_all_recursive_lock<test::named_sync_wrapper<named_recursive_mutex> >(); 29 } 30 catch(std::exception &ex){ 31 named_recursive_mutex::remove(test::get_process_id_name()); 32 std::cout << ex.what() << std::endl; 33 return 1; 34 } 35 named_recursive_mutex::remove(test::get_process_id_name()); 36 return 0; 37 } 38 39