Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86632 - in branches/release: boost/signals2 boost/signals2/detail libs/signals2 libs/signals2/doc libs/signals2/doc/reference libs/signals2/test
From: fmhess_at_[hidden]
Date: 2013-11-11 22:02:07


Author: fmhess
Date: 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013)
New Revision: 86632
URL: http://svn.boost.org/trac/boost/changeset/86632

Log:
Merge from trunk. Fixes #9103

Properties modified:
   branches/release/boost/signals2/ (props changed)
   branches/release/libs/signals2/ (props changed)
Text files modified:
   branches/release/boost/signals2/detail/auto_buffer.hpp | 2
   branches/release/boost/signals2/detail/lwm_nop.hpp | 2
   branches/release/boost/signals2/detail/lwm_pthreads.hpp | 2
   branches/release/boost/signals2/detail/lwm_win32_cs.hpp | 2
   branches/release/boost/signals2/detail/signal_template.hpp | 1
   branches/release/boost/signals2/mutex.hpp | 2
   branches/release/libs/signals2/doc/porting.xml | 14 ++++++++++
   branches/release/libs/signals2/doc/reference/signal_header.xml | 4 ---
   branches/release/libs/signals2/test/deletion_test.cpp | 48 ++++++++++++++++++++++++++++++++++++++++
   9 files changed, 66 insertions(+), 11 deletions(-)

Modified: branches/release/boost/signals2/detail/auto_buffer.hpp
==============================================================================
--- branches/release/boost/signals2/detail/auto_buffer.hpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/boost/signals2/detail/auto_buffer.hpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -8,7 +8,7 @@
 
 #include <boost/detail/workaround.hpp>
 
-#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+#if defined(_MSC_VER)
 # pragma once
 #endif
 

Modified: branches/release/boost/signals2/detail/lwm_nop.hpp
==============================================================================
--- branches/release/boost/signals2/detail/lwm_nop.hpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/boost/signals2/detail/lwm_nop.hpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -14,7 +14,7 @@
 
 // MS compatible compilers support #pragma once
 
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
 # pragma once
 #endif
 

Modified: branches/release/boost/signals2/detail/lwm_pthreads.hpp
==============================================================================
--- branches/release/boost/signals2/detail/lwm_pthreads.hpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/boost/signals2/detail/lwm_pthreads.hpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -14,7 +14,7 @@
 
 // MS compatible compilers support #pragma once
 
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
 # pragma once
 #endif
 

Modified: branches/release/boost/signals2/detail/lwm_win32_cs.hpp
==============================================================================
--- branches/release/boost/signals2/detail/lwm_win32_cs.hpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/boost/signals2/detail/lwm_win32_cs.hpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -14,7 +14,7 @@
 
 // MS compatible compilers support #pragma once
 
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
 # pragma once
 #endif
 

Modified: branches/release/boost/signals2/detail/signal_template.hpp
==============================================================================
--- branches/release/boost/signals2/detail/signal_template.hpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/boost/signals2/detail/signal_template.hpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -657,7 +657,6 @@
       {};
       virtual ~BOOST_SIGNALS2_SIGNAL_CLASS_NAME(BOOST_SIGNALS2_NUM_ARGS)()
       {
- disconnect_all_slots();
       }
       connection connect(const slot_type &slot, connect_position position = at_back)
       {

Modified: branches/release/boost/signals2/mutex.hpp
==============================================================================
--- branches/release/boost/signals2/mutex.hpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/boost/signals2/mutex.hpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -18,7 +18,7 @@
 
 // MS compatible compilers support #pragma once
 
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#if defined(_MSC_VER)
 # pragma once
 #endif
 

Modified: branches/release/libs/signals2/doc/porting.xml
==============================================================================
--- branches/release/libs/signals2/doc/porting.xml Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/libs/signals2/doc/porting.xml 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -227,8 +227,20 @@
   </section>
   <section id="signals2.api_history">
     <title>Signals2 API Development</title>
+ <section id="signals2.api_history.1-56">
+ <title>Version 1.56</title>
+ <para>
+ Version 1.56 modified the behavior of the signal destructor, in that it no longer
+ explicitly calls disconnect_all_slots. Any signal invocations running
+ concurrently with the signal destructor should now complete normally, rather
+ than skipping all remaining slots. Once all concurrent signal invocations
+ complete, all connections to the deleted signal will still ultimately
+ be disconnected. This change brings Boost.Signals2
+ behavior closer to the behavior of the original Boost.Signals library.
+ </para>
+ </section>
     <section id="signals2.api_history.1-45">
- <title>Version 1.4x</title>
+ <title>Version 1.45</title>
       <para>
         Version 1.45 added <methodname>slot::track_foreign</methodname>(). This method allows tracking
         of objects owned by <code>shared_ptr</code> classes other than <classname>boost::shared_ptr</classname>,

Modified: branches/release/libs/signals2/doc/reference/signal_header.xml
==============================================================================
--- branches/release/libs/signals2/doc/reference/signal_header.xml Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/libs/signals2/doc/reference/signal_header.xml 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -140,10 +140,6 @@
           <postconditions><para><computeroutput>this-&gt;<methodname>empty</methodname>()</computeroutput></para></postconditions>
         </constructor>
 
- <destructor>
- <effects><para>Disconnects all slots connected to <computeroutput>*this</computeroutput>.</para></effects>
- </destructor>
-
         <method-group name="connection management">
           <overloaded-method name="connect">
             <signature>

Modified: branches/release/libs/signals2/test/deletion_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/deletion_test.cpp Mon Nov 11 21:49:58 2013 (r86631)
+++ branches/release/libs/signals2/test/deletion_test.cpp 2013-11-11 22:02:07 EST (Mon, 11 Nov 2013) (r86632)
@@ -238,6 +238,53 @@
   BOOST_CHECK(test_output == "013");
 }
 
+struct signal_deletion_tester
+{
+public:
+ signal_deletion_tester() {
+ b_has_run = false;
+ sig = new boost::signals2::signal<void(void)>();
+ connection0 = sig->connect(0, boost::bind(&signal_deletion_tester::a, this));
+ connection1 = sig->connect(1, boost::bind(&signal_deletion_tester::b, this));
+ }
+
+ ~signal_deletion_tester()
+ {
+ if(sig != 0)
+ delete sig;
+ }
+
+ void a()
+ {
+ if(sig != 0)
+ delete sig;
+ sig = 0;
+ }
+
+ void b()
+ {
+ b_has_run = true;
+ }
+
+ boost::signals2::signal<void(void)> *sig;
+ bool b_has_run;
+ boost::signals2::connection connection1;
+ boost::signals2::connection connection2;
+};
+
+// If a signal is deleted mid-invocation, the invocation in progress
+// should complete normally. Once all invocations complete, all
+// slots which were connected to the deleted signal should be in the
+// disconnected state.
+static void test_signal_deletion()
+{
+ signal_deletion_tester tester;
+ (*tester.sig)();
+ BOOST_CHECK(tester.b_has_run);
+ BOOST_CHECK(tester.connection0.connected() == false);
+ BOOST_CHECK(tester.connection1.connected() == false);
+}
+
 int test_main(int, char* [])
 {
   test_remove_self();
@@ -245,5 +292,6 @@
   test_remove_after();
   test_bloodbath();
   test_disconnect_equal();
+ test_signal_deletion();
   return 0;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk