Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53091 - in trunk: boost/signals2 libs/signals2/doc/reference
From: fmhess_at_[hidden]
Date: 2009-05-18 12:59:29


Author: fmhess
Date: 2009-05-18 12:59:28 EDT (Mon, 18 May 2009)
New Revision: 53091
URL: http://svn.boost.org/trac/boost/changeset/53091

Log:
Added ability to create a shared_connection_block which is initially
not blocking.

Text files modified:
   trunk/boost/signals2/shared_connection_block.hpp | 4 ++--
   trunk/libs/signals2/doc/reference/shared_connection_block.xml | 18 ++++++++++++------
   2 files changed, 14 insertions(+), 8 deletions(-)

Modified: trunk/boost/signals2/shared_connection_block.hpp
==============================================================================
--- trunk/boost/signals2/shared_connection_block.hpp (original)
+++ trunk/boost/signals2/shared_connection_block.hpp 2009-05-18 12:59:28 EDT (Mon, 18 May 2009)
@@ -22,10 +22,10 @@
     class shared_connection_block
     {
     public:
- shared_connection_block(const connection &conn):
+ shared_connection_block(const connection &conn, bool initially_blocked = true):
         _weak_connection_body(conn._weak_connection_body)
       {
- block();
+ if(initially_blocked) block();
       }
       void block()
       {

Modified: trunk/libs/signals2/doc/reference/shared_connection_block.xml
==============================================================================
--- trunk/libs/signals2/doc/reference/shared_connection_block.xml (original)
+++ trunk/libs/signals2/doc/reference/shared_connection_block.xml 2009-05-18 12:59:28 EDT (Mon, 18 May 2009)
@@ -46,15 +46,21 @@
           <parameter name="conn">
             <paramtype>const boost::signals2::connection &amp;</paramtype>
           </parameter>
+ <parameter name="initially_blocking">
+ <paramtype>bool</paramtype>
+ <default>true</default>
+ </parameter>
 
           <effects>
- <para>Creates a <code>shared_connection_block</code> which references
- the connection referenced by <code>conn</code>. The connection will
- initially be blocked, and remain so
- until <methodname>unblock</methodname> is called,
- or the <code>shared_connection_block</code> is destroyed.</para>
+ <para>Creates a <code>shared_connection_block</code> which can block
+ the connection referenced by <code>conn</code>. The <code>shared_connection_block</code>
+ will initially block the connection if and only if the
+ <code>initially_blocking</code>
+ parameter is <code>true</code>. The block on the connection may be released
+ by calling the <methodname>unblock</methodname> method,
+ or destroying the <code>shared_connection_block</code> object.</para>
           </effects>
- <postconditions><para><code>this->blocking() == true</code></para></postconditions>
+ <postconditions><para><code>this->blocking() == initially_blocking</code></para></postconditions>
         </constructor>
         <destructor>
           <effects><para>If <methodname>blocking</methodname>() is true, releases the connection block.</para></effects>


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