Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59236 - in sandbox/fiber/boost/fiber: . spin
From: oliver.kowalke_at_[hidden]
Date: 2010-01-23 07:23:37


Author: olli
Date: 2010-01-23 07:23:36 EST (Sat, 23 Jan 2010)
New Revision: 59236
URL: http://svn.boost.org/trac/boost/changeset/59236

Log:
- corrections on channel (deactivate() )

Text files modified:
   sandbox/fiber/boost/fiber/bounded_channel.hpp | 20 ++------------------
   sandbox/fiber/boost/fiber/spin/bounded_channel.hpp | 20 ++------------------
   sandbox/fiber/boost/fiber/spin/unbounded_channel.hpp | 1 +
   sandbox/fiber/boost/fiber/unbounded_channel.hpp | 1 +
   4 files changed, 6 insertions(+), 36 deletions(-)

Modified: sandbox/fiber/boost/fiber/bounded_channel.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/bounded_channel.hpp (original)
+++ sandbox/fiber/boost/fiber/bounded_channel.hpp 2010-01-23 07:23:36 EST (Sat, 23 Jan 2010)
@@ -142,32 +142,16 @@
                 use_count_( 0)
         {}
 
- void upper_bound( std::size_t hwm)
- {
- if ( hwm < lwm_)
- throw invalid_watermark();
- unsigned int tmp( hwm_);
- hwm_ = hwm;
- if ( hwm_ > tmp) not_full_cond_.notify_one();
- }
-
         std::size_t upper_bound() const
         { return hwm_; }
 
- void lower_bound( std::size_t lwm)
- {
- if ( lwm > hwm_ )
- throw invalid_watermark();
- unsigned int tmp( lwm_);
- lwm_ = lwm;
- if ( lwm_ > tmp) not_full_cond_.notify_one();
- }
-
         std::size_t lower_bound() const
         { return lwm_; }
 
         void deactivate()
         {
+ mutex::scoped_lock head_lk( head_mtx_);
+ mutex::scoped_lock tail_lk( tail_mtx_);
                 deactivate_();
                 not_empty_cond_.notify_all();
                 not_full_cond_.notify_all();

Modified: sandbox/fiber/boost/fiber/spin/bounded_channel.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin/bounded_channel.hpp (original)
+++ sandbox/fiber/boost/fiber/spin/bounded_channel.hpp 2010-01-23 07:23:36 EST (Sat, 23 Jan 2010)
@@ -145,27 +145,9 @@
                 use_count_( 0)
         {}
 
- void upper_bound_( std::size_t hwm)
- {
- if ( hwm < lwm_)
- throw invalid_watermark();
- unsigned int tmp( hwm_);
- hwm_ = hwm;
- if ( hwm_ > tmp) not_full_cond_.notify_one();
- }
-
         std::size_t upper_bound() const
         { return hwm_; }
 
- void lower_bound_( std::size_t lwm)
- {
- if ( lwm > hwm_ )
- throw invalid_watermark();
- unsigned int tmp( lwm_);
- lwm_ = lwm;
- if ( lwm_ > tmp) not_full_cond_.notify_one();
- }
-
         std::size_t lower_bound() const
         { return lwm_; }
 
@@ -174,6 +156,8 @@
 
         void deactivate()
         {
+ mutex::scoped_lock head_lk( head_mtx_);
+ mutex::scoped_lock tail_lk( tail_mtx_);
                 deactivate_();
                 not_empty_cond_.notify_all();
                 not_full_cond_.notify_all();

Modified: sandbox/fiber/boost/fiber/spin/unbounded_channel.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin/unbounded_channel.hpp (original)
+++ sandbox/fiber/boost/fiber/spin/unbounded_channel.hpp 2010-01-23 07:23:36 EST (Sat, 23 Jan 2010)
@@ -116,6 +116,7 @@
 
         void deactivate()
         {
+ mutex::scoped_lock lk( head_mtx_);
                 deactivate_();
                 not_empty_cond_.notify_all();
         }

Modified: sandbox/fiber/boost/fiber/unbounded_channel.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/unbounded_channel.hpp (original)
+++ sandbox/fiber/boost/fiber/unbounded_channel.hpp 2010-01-23 07:23:36 EST (Sat, 23 Jan 2010)
@@ -107,6 +107,7 @@
 
         void deactivate()
         {
+ mutex::scoped_lock lk( head_mtx_);
                 deactivate_();
                 not_empty_cond_.notify_all();
         }


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