|
From: Frank M. H. <fm...@us...> - 2007-03-02 16:00:41
|
Update of /cvsroot/boost-sandbox/boost-sandbox/libs/thread_safe_signals/test In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32237/libs/thread_safe_signals/test Modified Files: deletion_test.cpp Log Message: Got rid of signalslib::connection::block() and unblock() and replaced them with exception-safe signalslib::shared_connection_block() class. The new way is also more useable in a multi-threaded context, since it prevents one thread from unexpectedly unblocking a connection that another thread wants blocked. Index: deletion_test.cpp =================================================================== RCS file: /cvsroot/boost-sandbox/boost-sandbox/libs/thread_safe_signals/test/deletion_test.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- deletion_test.cpp 28 Feb 2007 19:44:09 -0000 1.2 +++ deletion_test.cpp 2 Mar 2007 16:00:39 -0000 1.3 @@ -94,14 +94,15 @@ std::cout << "Blocking 2" << std::endl; - connections[2].block(); - test_output = ""; - s0(); std::cout << std::endl; - BOOST_CHECK(test_output == "13"); + { + boost::BOOST_SIGNALS_NAMESPACE::shared_connection_block block(connections[2]); + test_output = ""; + s0(); std::cout << std::endl; + BOOST_CHECK(test_output == "13"); + } std::cout << "Unblocking 2" << std::endl; - connections[2].unblock(); test_output = ""; s0(); std::cout << std::endl; BOOST_CHECK(test_output == "123"); |