Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58312 - in sandbox/fiber: boost/fiber boost/fiber/detail libs/fiber/src
From: oliver.kowalke_at_[hidden]
Date: 2009-12-12 04:52:24


Author: olli
Date: 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
New Revision: 58312
URL: http://svn.boost.org/trac/boost/changeset/58312

Log:
- delete

Removed:
   sandbox/fiber/boost/fiber/detail/move.hpp
   sandbox/fiber/boost/fiber/spin_auto_reset_event.hpp
   sandbox/fiber/boost/fiber/spin_barrier.hpp
   sandbox/fiber/boost/fiber/spin_condition.hpp
   sandbox/fiber/boost/fiber/spin_count_down_event.hpp
   sandbox/fiber/boost/fiber/spin_manual_reset_event.hpp
   sandbox/fiber/libs/fiber/src/spin_auto_reset_event.cpp
   sandbox/fiber/libs/fiber/src/spin_barrier.cpp
   sandbox/fiber/libs/fiber/src/spin_condition.cpp
   sandbox/fiber/libs/fiber/src/spin_count_down_event.cpp
   sandbox/fiber/libs/fiber/src/spin_manual_reset_event.cpp
   sandbox/fiber/libs/fiber/src/spin_mutex.cpp

Deleted: sandbox/fiber/boost/fiber/detail/move.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/detail/move.hpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,56 +0,0 @@
-// Distributed under the Boost Software License, Version 1.0. (See
-// accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// (C) Copyright 2007-8 Anthony Williams
-
-#ifndef BOOST_FIBERS_DETAIL_MOVE_HPP
-#define BOOST_FIBERS_DETAIL_MOVE_HPP
-
-#include <boost/config.hpp>
-
-#ifndef BOOST_NO_SFINAE
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-#endif
-
-#include <boost/config/abi_prefix.hpp>
-
-namespace boost {
-namespace detail {
-
-template< typename F >
-struct fiber_move_t
-{
- F & f;
-
- explicit fiber_move_t( F & f_) :
- f( f_)
- {}
-
- F & operator*() const
- { return f; }
-
- F * operator->() const
- { return & f; }
-
-private:
- void operator=( fiber_move_t &);
-};
-
-}
-
-#ifndef BOOST_NO_SFINAE
-template< typename F >
-typename enable_if< is_convertible< F &, detail::fiber_move_t< F > >, F >::type move( F & f)
-{ return F( detail::fiber_move_t< F >( f) ); }
-#endif
-
-template< typename F >
-detail::fiber_move_t< F > move( detail::fiber_move_t< F > f)
-{ return f; }
-
-}
-
-#include <boost/config/abi_suffix.hpp>
-
-#endif // BOOST_FIBERS_DETAIL_MOVE_H

Deleted: sandbox/fiber/boost/fiber/spin_auto_reset_event.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin_auto_reset_event.hpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,39 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_FIBERS_SPIN_AUTO_RESET_EVENT_H
-#define BOOST_FIBERS_SPIN_AUTO_RESET_EVENT_H
-
-#include <boost/cstdint.hpp>
-#include <boost/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-class spin_auto_reset_event : private noncopyable
-{
-private:
- enum state_t
- {
- RESET = 0,
- SET
- };
-
- volatile uint32_t state_;
-
-public:
- explicit spin_auto_reset_event( bool = false);
-
- void set();
-
- void wait();
-
- bool try_wait();
-};
-
-}}
-
-#endif // BOOST_FIBERS_SPIN_AUTO_RESET_EVENT_H

Deleted: sandbox/fiber/boost/fiber/spin_barrier.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin_barrier.hpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,36 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_FIBERS_SPIN_BARRIER_H
-#define BOOST_FIBERS_SPIN_BARRIER_H
-
-#include <boost/cstdint.hpp>
-#include <boost/utility.hpp>
-
-#include <boost/fiber/spin_condition.hpp>
-#include <boost/fiber/spin_mutex.hpp>
-
-namespace boost {
-namespace fibers {
-
-class spin_barrier : private noncopyable
-{
-private:
- uint32_t initial_;
- uint32_t current_;
- bool cycle_;
- spin_mutex mtx_;
- spin_condition cond_;
-
-public:
- spin_barrier( uint32_t);
-
- bool wait();
-};
-
-}}
-
-#endif // BOOST_FIBERS_SPIN_BARRIER_H

Deleted: sandbox/fiber/boost/fiber/spin_condition.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin_condition.hpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,71 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-//
-// based on boost::interprocess::sync::interprocess_spin_condition
-
-#ifndef BOOST_FIBERS_SPIN_CONDITION_H
-#define BOOST_FIBERS_SPIN_CONDITION_H
-
-#include <boost/cstdint.hpp>
-#include <boost/utility.hpp>
-
-#include <boost/fiber/exceptions.hpp>
-#include <boost/fiber/spin_mutex.hpp>
-
-namespace boost {
-namespace fibers {
-
-class spin_condition : private noncopyable
-{
-private:
- enum command_t
- {
- SLEEPING = 0,
- NOTIFY_ONE,
- NOTIFY_ALL
- };
-
- volatile uint32_t cmd_;
- volatile uint32_t waiters_;
- spin_mutex enter_mtx_;
- spin_mutex check_mtx_;
-
- void wait_( spin_mutex &);
-
- void notify_( uint32_t);
-
-public:
- spin_condition();
-
- void notify_one();
-
- void notify_all();
-
- template< typename Lock >
- void wait( Lock & lk)
- {
- if ( ! lk)
- throw lock_error();
- wait_( * lk.mutex() );
- }
-
- template<
- typename Lock,
- typename Pred
- >
- void wait( Lock & lk, Pred pred)
- {
- if ( ! lk)
- throw lock_error();
-
- while ( ! pred() )
- wait_( * lk.mutex() );
- }
-};
-
-}}
-
-#endif // BOOST_FIBERS_SPIN_CONDITION_H

Deleted: sandbox/fiber/boost/fiber/spin_count_down_event.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin_count_down_event.hpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,38 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_FIBERS_SPIN_COUNT_DOWN_EVENT_H
-#define BOOST_FIBERS_SPIN_COUNT_DOWN_EVENT_H
-
-#include <boost/cstdint.hpp>
-#include <boost/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-class spin_count_down_event : private noncopyable
-{
-private:
- uint32_t initial_;
- volatile uint32_t current_;
-
-public:
- explicit spin_count_down_event( uint32_t);
-
- uint32_t initial() const;
-
- uint32_t current() const;
-
- bool is_set() const;
-
- void set();
-
- void wait();
-};
-
-}}
-
-#endif // BOOST_FIBERS_SPIN_COUNT_DOWN_EVENT_H

Deleted: sandbox/fiber/boost/fiber/spin_manual_reset_event.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/spin_manual_reset_event.hpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,45 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_FIBERS_SPIN_MANUAL_RESET_EVENT_H
-#define BOOST_FIBERS_SPIN_MANUAL_RESET_EVENT_H
-
-#include <boost/cstdint.hpp>
-#include <boost/utility.hpp>
-
-#include <boost/fiber/spin_mutex.hpp>
-
-namespace boost {
-namespace fibers {
-
-class spin_manual_reset_event : private noncopyable
-{
-private:
- enum state_t
- {
- RESET = 0,
- SET
- };
-
- volatile uint32_t state_;
- volatile uint32_t waiters_;
- spin_mutex enter_mtx_;
-
-public:
- explicit spin_manual_reset_event( bool = false);
-
- void set();
-
- void reset();
-
- void wait();
-
- bool try_wait();
-};
-
-}}
-
-#endif // BOOST_FIBERS_SPIN_MANUAL_RESET_EVENT_H

Deleted: sandbox/fiber/libs/fiber/src/spin_auto_reset_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/spin_auto_reset_event.cpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,48 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include "boost/fiber/spin_auto_reset_event.hpp"
-
-#include <boost/fiber/detail/atomic.hpp>
-#include <boost/fiber/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-spin_auto_reset_event::spin_auto_reset_event( bool isset) :
- state_(
- isset ?
- static_cast< uint32_t >( SET) :
- static_cast< uint32_t >( RESET) )
-{}
-
-void
-spin_auto_reset_event::set()
-{ detail::atomic_exchange( & state_, static_cast< uint32_t >( SET) ); }
-
-void
-spin_auto_reset_event::wait()
-{
- uint32_t expected = static_cast< uint32_t >( SET);
- while ( ! detail::atomic_compare_exchange_strong(
- & state_, & expected,
- static_cast< uint32_t >( RESET) ) )
- {
- this_fiber::yield();
- expected = static_cast< uint32_t >( SET);
- }
-}
-
-bool
-spin_auto_reset_event::try_wait()
-{
- uint32_t expected = static_cast< uint32_t >( SET);
- return detail::atomic_compare_exchange_strong(
- & state_, & expected,
- static_cast< uint32_t >( RESET) );
-}
-
-}}

Deleted: sandbox/fiber/libs/fiber/src/spin_barrier.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/spin_barrier.cpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,44 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include "boost/fiber/spin_barrier.hpp"
-
-#include <stdexcept>
-
-#include <boost/assert.hpp>
-
-namespace boost {
-namespace fibers {
-
-spin_barrier::spin_barrier( uint32_t initial) :
- initial_( initial),
- current_( initial_),
- cycle_( true),
- mtx_(),
- cond_()
-{ if ( initial == 0) throw std::invalid_argument("invalid barrier count"); }
-
-bool
-spin_barrier::wait()
-{
- spin_mutex::scoped_lock lk( mtx_);
- bool cycle( cycle_);
- if ( 0 == --current_)
- {
- cycle_ = ! cycle_;
- current_ = initial_;
- cond_.notify_all();
- return true;
- }
- else
- {
- while ( cycle == cycle_)
- cond_.wait( lk);
- }
- return false;
-}
-
-}}

Deleted: sandbox/fiber/libs/fiber/src/spin_condition.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/spin_condition.cpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,102 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include "boost/fiber/spin_condition.hpp"
-
-#include <boost/assert.hpp>
-#include <boost/thread.hpp>
-
-#include <boost/fiber/detail/atomic.hpp>
-#include <boost/fiber/spin_mutex.hpp>
-#include <boost/fiber/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-void
-spin_condition::notify_( uint32_t cmd)
-{
- enter_mtx_.lock();
-
- if ( 0 == detail::atomic_load( & waiters_) )
- {
- enter_mtx_.unlock();
- return;
- }
-
- uint32_t expected = static_cast< uint32_t >( SLEEPING);
- while ( ! detail::atomic_compare_exchange_strong(
- & cmd_, & expected, cmd) )
- this_fiber::yield();
-}
-
-void
-spin_condition::wait_( spin_mutex & mtx)
-{
- {
- spin_mutex::scoped_lock lk( enter_mtx_);
- BOOST_ASSERT( lk);
- detail::atomic_fetch_add( & waiters_, 1);
- mtx.unlock();
- }
-
- bool unlock_enter_mtx = false;
- for (;;)
- {
- while ( static_cast< uint32_t >( SLEEPING) == detail::atomic_load( & cmd_) )
- this_fiber::yield();
-
- spin_mutex::scoped_lock lk( check_mtx_);
- BOOST_ASSERT( lk);
-
- uint32_t expected = static_cast< uint32_t >( NOTIFY_ONE);
- detail::atomic_compare_exchange_strong(
- & cmd_, & expected,
- static_cast< uint32_t >( SLEEPING) );
- if ( static_cast< uint32_t >( SLEEPING) == expected)
- continue;
- else if ( static_cast< uint32_t >( NOTIFY_ONE) == expected)
- {
- unlock_enter_mtx = true;
- detail::atomic_fetch_sub( & waiters_, 1);
- break;
- }
- else
- {
- unlock_enter_mtx = 1 == detail::atomic_fetch_sub( & waiters_, 1);
- if ( unlock_enter_mtx)
- {
- expected = static_cast< uint32_t >( NOTIFY_ALL);
- detail::atomic_compare_exchange_strong(
- & cmd_, & expected,
- static_cast< uint32_t >( SLEEPING) );
- }
- break;
- }
- }
-
- if ( unlock_enter_mtx)
- enter_mtx_.unlock();
-
- mtx.lock();
-}
-
-spin_condition::spin_condition() :
- cmd_( static_cast< uint32_t >( SLEEPING) ),
- waiters_( 0),
- enter_mtx_(),
- check_mtx_()
-{}
-
-void
-spin_condition::notify_one()
-{ notify_( static_cast< uint32_t >( NOTIFY_ONE) ); }
-
-void
-spin_condition::notify_all()
-{ notify_( static_cast< uint32_t >( NOTIFY_ALL) ); }
-
-}}

Deleted: sandbox/fiber/libs/fiber/src/spin_count_down_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/spin_count_down_event.cpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,53 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include "boost/fiber/spin_count_down_event.hpp"
-
-#include <boost/fiber/detail/atomic.hpp>
-#include <boost/fiber/spin_mutex.hpp>
-#include <boost/fiber/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-spin_count_down_event::spin_count_down_event( uint32_t initial) :
- initial_( initial),
- current_( initial_)
-{}
-
-uint32_t
-spin_count_down_event::initial() const
-{ return initial_; }
-
-uint32_t
-spin_count_down_event::current() const
-{ return detail::atomic_load( & current_); }
-
-bool
-spin_count_down_event::is_set() const
-{ return 0 == detail::atomic_load( & current_); }
-
-void
-spin_count_down_event::set()
-{
- for (;;)
- {
- if ( 0 == detail::atomic_load( & current_) )
- return;
- uint32_t expected = current_;
- if ( detail::atomic_compare_exchange_strong( & current_, & expected, expected - 1) )
- return;
- }
-}
-
-void
-spin_count_down_event::wait()
-{
- while ( 0 != detail::atomic_load( & current_) )
- this_fiber::yield();
-}
-
-}}

Deleted: sandbox/fiber/libs/fiber/src/spin_manual_reset_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/spin_manual_reset_event.cpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,82 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include "boost/fiber/spin_manual_reset_event.hpp"
-
-#include <boost/assert.hpp>
-
-#include <boost/fiber/detail/atomic.hpp>
-#include <boost/fiber/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-spin_manual_reset_event::spin_manual_reset_event( bool isset) :
- state_(
- isset ?
- static_cast< uint32_t >( SET) :
- static_cast< uint32_t >( RESET) ),
- waiters_( 0),
- enter_mtx_()
-{}
-
-void
-spin_manual_reset_event::set()
-{
- enter_mtx_.lock();
-
- uint32_t expected = static_cast< uint32_t >( RESET);
- if ( ! detail::atomic_compare_exchange_strong(
- & state_, & expected,
- static_cast< uint32_t >( SET) ) ||
- ! detail::atomic_load( & waiters_ ) )
- enter_mtx_.unlock();
-}
-
-void
-spin_manual_reset_event::reset()
-{
- spin_mutex::scoped_lock lk( enter_mtx_);
- BOOST_ASSERT( lk);
-
- detail::atomic_exchange( & state_,
- static_cast< uint32_t >( RESET) );
-}
-
-void
-spin_manual_reset_event::wait()
-{
- {
- spin_mutex::scoped_lock lk( enter_mtx_);
- BOOST_ASSERT( lk);
- detail::atomic_fetch_add( & waiters_, 1);
- }
-
- while ( static_cast< uint32_t >( RESET) == detail::atomic_load( & state_) )
- this_fiber::yield();
-
- if ( 1 == detail::atomic_fetch_sub( & waiters_, 1) )
- enter_mtx_.unlock();
-}
-
-bool
-spin_manual_reset_event::try_wait()
-{
- {
- spin_mutex::scoped_lock lk( enter_mtx_);
- BOOST_ASSERT( lk);
- detail::atomic_fetch_add( & waiters_, 1);
- }
-
- bool result = static_cast< uint32_t >( SET) == detail::atomic_load( & state_);
-
- if ( 1 == detail::atomic_fetch_sub( & waiters_, 1) )
- enter_mtx_.unlock();
-
- return result;
-}
-
-}}

Deleted: sandbox/fiber/libs/fiber/src/spin_mutex.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/spin_mutex.cpp 2009-12-12 04:52:23 EST (Sat, 12 Dec 2009)
+++ (empty file)
@@ -1,43 +0,0 @@
-
-// Copyright Oliver Kowalke 2009.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <boost/fiber/spin_mutex.hpp>
-
-#include <boost/fiber/detail/atomic.hpp>
-#include <boost/fiber/utility.hpp>
-
-namespace boost {
-namespace fibers {
-
-spin_mutex::spin_mutex() :
- state_( 0)
-{}
-
-void
-spin_mutex::lock()
-{
- for (;;)
- {
- uint32_t expected = 0;
- if ( detail::atomic_compare_exchange_strong( & state_, & expected, 1) )
- break;
- else
- this_fiber::yield();
- }
-}
-
-bool
-spin_mutex::try_lock()
-{
- uint32_t expected = 0;
- return detail::atomic_compare_exchange_strong( & state_, & expected, 1);
-}
-
-void
-spin_mutex::unlock()
-{ detail::atomic_exchange( & state_, 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