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