|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r58521 - in sandbox/fiber: . boost/fiber libs/fiber/examples libs/fiber/src libs/fiber/test
From: oliver.kowalke_at_[hidden]
Date: 2009-12-23 18:41:33
Author: olli
Date: 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
New Revision: 58521
URL: http://svn.boost.org/trac/boost/changeset/58521
Log:
- default stacksize as public static member
- pass stacksize as argument to factory methods for fiber
Text files modified:
sandbox/fiber/boost/fiber/fiber.hpp | 57 +++++++++++----------------------------
sandbox/fiber/boost/fiber/scheduler.hpp | 49 +++++++++++++---------------------
sandbox/fiber/change.log | 5 +++
sandbox/fiber/libs/fiber/examples/at_exit.cpp | 2
sandbox/fiber/libs/fiber/examples/barrier_mt.cpp | 4 +-
sandbox/fiber/libs/fiber/examples/cancel.cpp | 4 +-
sandbox/fiber/libs/fiber/examples/future.cpp | 2
sandbox/fiber/libs/fiber/examples/future_mt.cpp | 8 ++--
sandbox/fiber/libs/fiber/examples/interrupt.cpp | 12 ++++----
sandbox/fiber/libs/fiber/examples/join.cpp | 4 +-
sandbox/fiber/libs/fiber/examples/migrate_mt.cpp | 4 +-
sandbox/fiber/libs/fiber/examples/ping_pong.cpp | 6 ++--
sandbox/fiber/libs/fiber/examples/ping_pong_mt.cpp | 4 +-
sandbox/fiber/libs/fiber/examples/simple.cpp | 4 +-
sandbox/fiber/libs/fiber/src/fiber.cpp | 2
sandbox/fiber/libs/fiber/test/test_at_exit.cpp | 2
sandbox/fiber/libs/fiber/test/test_auto_reset_event.cpp | 12 +++++--
sandbox/fiber/libs/fiber/test/test_barrier.cpp | 4 +-
sandbox/fiber/libs/fiber/test/test_cancel.cpp | 8 ++--
sandbox/fiber/libs/fiber/test/test_condition.cpp | 33 +++++++++++++++-------
sandbox/fiber/libs/fiber/test/test_count_down_event.cpp | 3 +
sandbox/fiber/libs/fiber/test/test_fiber.cpp | 31 ++++++++++++++-------
sandbox/fiber/libs/fiber/test/test_interrupt.cpp | 12 ++++----
sandbox/fiber/libs/fiber/test/test_join.cpp | 16 +++++-----
sandbox/fiber/libs/fiber/test/test_manual_reset_event.cpp | 18 ++++++++----
sandbox/fiber/libs/fiber/test/test_mutex.cpp | 6 ++--
sandbox/fiber/libs/fiber/test/test_priority.cpp | 2
sandbox/fiber/libs/fiber/test/test_scheduler.cpp | 57 +++++++++++++++++++++++----------------
sandbox/fiber/libs/fiber/test/test_spin_auto_reset_event.cpp | 12 +++++--
sandbox/fiber/libs/fiber/test/test_spin_barrier.cpp | 4 +-
sandbox/fiber/libs/fiber/test/test_spin_condition.cpp | 30 ++++++++++++++-------
sandbox/fiber/libs/fiber/test/test_spin_count_down_event.cpp | 3 +
sandbox/fiber/libs/fiber/test/test_spin_future.cpp | 6 ++--
sandbox/fiber/libs/fiber/test/test_spin_manual_reset_event.cpp | 18 ++++++++----
sandbox/fiber/libs/fiber/test/test_spin_mutex.cpp | 6 ++--
sandbox/fiber/libs/fiber/test/test_utility.cpp | 8 ++--
36 files changed, 244 insertions(+), 214 deletions(-)
Modified: sandbox/fiber/boost/fiber/fiber.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/fiber.hpp (original)
+++ sandbox/fiber/boost/fiber/fiber.hpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -7,6 +7,7 @@
#ifndef BOOST_FIBERS_FIBER_H
#define BOOST_FIBERS_FIBER_H
+#include <cstddef>
#include <iostream>
#include <boost/bind.hpp>
@@ -44,8 +45,6 @@
static void convert_thread_to_fiber();
static void convert_fiber_to_thread();
- static unsigned int default_stacksize;
-
BOOST_COPYABLE_AND_MOVABLE( fiber);
detail::info_base::ptr info_;
@@ -58,7 +57,7 @@
template< typename Fn >
static detail::info_base::ptr make_info_(
- unsigned int stack_size, Fn fn)
+ Fn fn, std::size_t stack_size)
{
return detail::info_base::ptr(
new detail::info< Fn >( fn, stack_size) );
@@ -66,25 +65,22 @@
template< typename Fn >
static detail::info_base::ptr make_info_(
- unsigned int stack_size, BOOST_RV_REF( Fn) fn)
+ BOOST_RV_REF( Fn) fn, std::size_t stack_size)
{
return detail::info_base::ptr(
new detail::info< Fn >( fn, stack_size) );
}
public:
+ static std::size_t default_stacksize;
+
class id;
fiber();
template< typename Fn >
- explicit fiber( Fn fn) :
- info_( make_info_( default_stacksize, fn) )
- { init_(); }
-
- template< typename Fn >
- explicit fiber( unsigned int stack_size, Fn fn) :
- info_( make_info_( stack_size, fn) )
+ explicit fiber( Fn fn, std::size_t stack_size) :
+ info_( make_info_( fn, stack_size) )
{ init_(); }
#define BOOST_FIBER_ARG(z, n, unused) \
@@ -93,20 +89,12 @@
#define BOOST_FIBER_FIBER_CTOR(z, n, unused) \
template< typename Fn, BOOST_PP_ENUM_PARAMS(n, typename A) > \
- fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n)) : \
+ fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n), std::size_t stack_size) : \
info_( \
make_info_( \
- default_stacksize, \
- boost::bind( boost::type< void >(), fn, BOOST_PP_ENUM_PARAMS(n, a)) ) ) \
+ boost::bind( boost::type< void >(), fn, BOOST_PP_ENUM_PARAMS(n, a) ), \
+ stack_size) ) \
{ init_(); } \
- \
- template< typename Fn, BOOST_PP_ENUM_PARAMS(n, typename A) > \
- fiber( unsigned int stack_size, Fn fn, BOOST_ENUM_FIBER_ARGS(n)) : \
- info_( \
- make_info_( \
- stack_size, \
- boost::bind( boost::type< void >(), fn, BOOST_PP_ENUM_PARAMS(n, a)) ) ) \
- { init_(); }
#ifndef BOOST_FIBER_MAX_ARITY
#define BOOST_FIBER_MAX_ARITY 10
@@ -117,13 +105,8 @@
#undef BOOST_FIBER_FIBER_CTOR
template< typename Fn >
- explicit fiber( BOOST_RV_REF( Fn) fn) :
- info_( make_info_( default_stacksize, fn) )
- { init_(); }
-
- template< typename Fn >
- explicit fiber( unsigned int stack_size, BOOST_RV_REF( Fn) fn) :
- info_( make_info_( stack_size, fn) )
+ explicit fiber( BOOST_RV_REF( Fn) fn, std::size_t stack_size) :
+ info_( make_info_( fn, stack_size) )
{ init_(); }
fiber( fiber const& other);
@@ -208,21 +191,13 @@
};
template< typename Fn >
-fiber make_fiber( Fn fn)
-{ return fiber( fn); }
-
-template< typename Fn >
-fiber make_fiber( unsigned int stack_size, Fn fn)
-{ return fiber( stack_size, fn); }
+fiber make_fiber( Fn fn, std::size_t stack_size)
+{ return fiber( fn, stack_size); }
#define BOOST_FIBER_MAKE_FIBER_FUNCTION(z, n, unused) \
template< typename Fn, BOOST_PP_ENUM_PARAMS(n, typename A) > \
-fiber make_fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n)) \
-{ return fiber( fn, BOOST_PP_ENUM_PARAMS(n, a) ); } \
-\
-template< typename Fn, BOOST_PP_ENUM_PARAMS(n, typename A) > \
-fiber make_fiber( unsigned int stack_size, Fn fn, BOOST_ENUM_FIBER_ARGS(n)) \
-{ return fiber( stack_size, fn, BOOST_PP_ENUM_PARAMS(n, a) ); }
+fiber make_fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n), std::size_t stack_size) \
+{ return fiber( fn, BOOST_PP_ENUM_PARAMS(n, a), stack_size); }
BOOST_PP_REPEAT_FROM_TO( 1, BOOST_FIBER_MAX_ARITY, BOOST_FIBER_MAKE_FIBER_FUNCTION, ~)
Modified: sandbox/fiber/boost/fiber/scheduler.hpp
==============================================================================
--- sandbox/fiber/boost/fiber/scheduler.hpp (original)
+++ sandbox/fiber/boost/fiber/scheduler.hpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -75,33 +75,12 @@
{ strategy_->add( f); }
template< typename Fn >
- void make_fiber( Fn fn)
- { strategy_->add( fiber( fn) ); }
+ void make_fiber( Fn fn, std::size_t stack_size)
+ { strategy_->add( fiber( fn, stack_size) ); }
template< typename Fn >
- void make_fiber( BOOST_RV_REF( Fn) fn)
- { strategy_->add( fiber( fn) ); }
-
- template< typename Fn >
- void make_fiber( std::size_t stack_size, Fn fn)
- { strategy_->add( fiber( stack_size, fn) ); }
-
- template< typename Fn >
- void make_fiber( std::size_t stack_size, BOOST_RV_REF( Fn) fn)
- { strategy_->add( fiber( stack_size, fn) ); }
-
- void migrate_fiber( fiber f)
- {
- if ( ! f) throw fiber_moved();
-
- strategy * st( f.info_->st);
- if ( ! st) throw fiber_error("fiber not attached");
- strategy_->migrate( f.info_->st->release( f.get_id() ) );
- }
-
- template< typename OtherStrategy >
- void migrate_fiber( fiber::id const& id, scheduler< OtherStrategy > & other)
- { strategy_->migrate( other.strategy_->release( id) ); }
+ void make_fiber( BOOST_RV_REF( Fn) fn, std::size_t stack_size)
+ { strategy_->add( fiber( fn, stack_size) ); }
#ifndef BOOST_FIBER_MAX_ARITY
#define BOOST_FIBER_MAX_ARITY 10
@@ -113,16 +92,26 @@
#define BOOST_FIBER_MAKE_FIBER_FUNCTION(z, n, unused) \
template< typename Fn, BOOST_PP_ENUM_PARAMS(n, typename A) > \
- void make_fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n)) \
- { strategy_->add( fiber( fn, BOOST_PP_ENUM_PARAMS(n, a) ) ); } \
- template< typename Fn, BOOST_PP_ENUM_PARAMS(n, typename A) > \
- void make_fiber( std::size_t stack_size, Fn fn, BOOST_ENUM_FIBER_ARGS(n)) \
- { strategy_->add( fiber( stack_size, fn, BOOST_PP_ENUM_PARAMS(n, a) ) ); }
+ void make_fiber( Fn fn, BOOST_ENUM_FIBER_ARGS(n), std::size_t stack_size) \
+ { strategy_->add( fiber( fn, BOOST_PP_ENUM_PARAMS(n, a), stack_size) ); }
BOOST_PP_REPEAT_FROM_TO( 1, BOOST_FIBER_MAX_ARITY, BOOST_FIBER_MAKE_FIBER_FUNCTION, ~)
#undef BOOST_FIBER_MAKE_FIBER_FUNCTION
#undef BOOST_FIBER_MAX_ARITY
+
+ void migrate_fiber( fiber f)
+ {
+ if ( ! f) throw fiber_moved();
+
+ strategy * st( f.info_->st);
+ if ( ! st) throw fiber_error("fiber not attached");
+ strategy_->migrate( f.info_->st->release( f.get_id() ) );
+ }
+
+ template< typename OtherStrategy >
+ void migrate_fiber( fiber::id const& id, scheduler< OtherStrategy > & other)
+ { strategy_->migrate( other.strategy_->release( id) ); }
};
}}
Modified: sandbox/fiber/change.log
==============================================================================
--- sandbox/fiber/change.log (original)
+++ sandbox/fiber/change.log 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -1,3 +1,8 @@
+0.3.3:
+------
+- default_stacksize is public static member of fiber
+- stacksize muÃt be given if a fiber is created
+
0.3.2:
------
- default stacksize = 64kB because of seg fault if value is too small
Modified: sandbox/fiber/libs/fiber/examples/at_exit.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/at_exit.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/at_exit.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -22,7 +22,7 @@
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( fn);
+ sched.make_fiber( fn, boost::fiber::default_stacksize);
std::cout << "start" << std::endl;
Modified: sandbox/fiber/libs/fiber/examples/barrier_mt.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/barrier_mt.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/barrier_mt.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -88,7 +88,7 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( & fn1, boost::ref( fb) );
+ sched.make_fiber( & fn1, boost::ref( fb), boost::fiber::default_stacksize);
tb.wait();
@@ -112,7 +112,7 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( & fn2, boost::ref( fb) );
+ sched.make_fiber( & fn2, boost::ref( fb), boost::fiber::default_stacksize);
tb.wait();
Modified: sandbox/fiber/libs/fiber/examples/cancel.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/cancel.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/cancel.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -41,9 +41,9 @@
{
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_1);
+ boost::fiber f( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_2, f);
+ sched.make_fiber( fn_2, f, boost::fiber::default_stacksize);
std::cout << "start" << std::endl;
std::cout << "fiber to be canceled " << f.get_id() << std::endl;
Modified: sandbox/fiber/libs/fiber/examples/future.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/future.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/future.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -22,7 +22,7 @@
boost::fibers::spin::packaged_task< std::string > pt( helloworld_fn);
boost::fibers::spin::unique_future< std::string > fu = pt.get_future();
- sched.make_fiber( boost::move( pt) );
+ sched.make_fiber( boost::move( pt), boost::fiber::default_stacksize);
for (;;)
{
Modified: sandbox/fiber/libs/fiber/examples/future_mt.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/future_mt.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/future_mt.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -112,8 +112,8 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( & increment_fn1);
- sched.make_fiber( & waiting_fn, fu);
+ sched.make_fiber( & increment_fn1, boost::fiber::default_stacksize);
+ sched.make_fiber( & waiting_fn, fu, boost::fiber::default_stacksize);
for (;;)
{
@@ -132,8 +132,8 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( & increment_fn2);
- sched.make_fiber( ca);
+ sched.make_fiber( & increment_fn2, boost::fiber::default_stacksize);
+ sched.make_fiber( ca, boost::fiber::default_stacksize);
for (;;)
{
Modified: sandbox/fiber/libs/fiber/examples/interrupt.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/interrupt.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/interrupt.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -67,9 +67,9 @@
{
boost::fibers::scheduler<> sched;
- boost::fiber f1( fn_1);
+ boost::fiber f1( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f1);
- sched.make_fiber( fn_4, f1);
+ sched.make_fiber( fn_4, f1, boost::fiber::default_stacksize);
std::cout << "start: interrupt fn_1()" << std::endl;
@@ -81,9 +81,9 @@
std::cout << "finish: value1 == " << value1 << std::endl;
- boost::fiber f2( fn_2);
+ boost::fiber f2( fn_2, boost::fiber::default_stacksize);
sched.submit_fiber( f2);
- sched.make_fiber( fn_4, f2);
+ sched.make_fiber( fn_4, f2, boost::fiber::default_stacksize);
std::cout << "start: interrupt fn_2()" << std::endl;
for (;;)
@@ -94,9 +94,9 @@
std::cout << "finish: value2 == " << value2 << std::endl;
- boost::fiber f3( fn_3);
+ boost::fiber f3( fn_3, boost::fiber::default_stacksize);
sched.submit_fiber( f3);
- sched.make_fiber( fn_4, f3);
+ sched.make_fiber( fn_4, f3, boost::fiber::default_stacksize);
std::cout << "start: interrupt fn_3()" << std::endl;
for (;;)
Modified: sandbox/fiber/libs/fiber/examples/join.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/join.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/join.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -42,9 +42,9 @@
{
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_1);
+ boost::fiber f( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_2, f);
+ sched.make_fiber( fn_2, f, boost::fiber::default_stacksize);
std::cout << "start" << std::endl;
std::cout << "fiber to be joined " << f.get_id() << std::endl;
Modified: sandbox/fiber/libs/fiber/examples/migrate_mt.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/migrate_mt.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/migrate_mt.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -34,7 +34,7 @@
fprintf( stderr, "start (thread1: %s)\n", os.str().c_str() );
boost::fibers::scheduler<> sched1;
- sched1.make_fiber( & g, msg, n);
+ sched1.make_fiber( & g, msg, n, boost::fiber::default_stacksize);
for ( int i = 0; i < 2; ++i)
sched1.run();
@@ -89,7 +89,7 @@
boost::fibers::scheduler<> sched;
boost::barrier b( 2);
- boost::fiber f( & g, "xyz", 4);
+ boost::fiber f( & g, "xyz", 4, boost::fiber::default_stacksize);
std::cout << "start" << std::endl;
Modified: sandbox/fiber/libs/fiber/examples/ping_pong.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/ping_pong.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/ping_pong.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -68,8 +68,8 @@
fifo_t buf1( sched);
fifo_t buf2( sched);
- sched.make_fiber( & ping, buf1, buf2);
- sched.make_fiber( & pong, buf2, buf1);
+ sched.make_fiber( & ping, buf1, buf2, boost::fiber::default_stacksize);
+ sched.make_fiber( & pong, buf2, buf1, boost::fiber::default_stacksize);
}
int main()
@@ -78,7 +78,7 @@
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( & f, boost::ref( sched) );
+ sched.make_fiber( & f, boost::ref( sched), boost::fiber::default_stacksize);
std::cout << "start" << std::endl;
Modified: sandbox/fiber/libs/fiber/examples/ping_pong_mt.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/ping_pong_mt.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/ping_pong_mt.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -93,7 +93,7 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( & ping, recv_buf, send_buf);
+ sched.make_fiber( & ping, recv_buf, send_buf, boost::fiber::default_stacksize);
for (;;)
{
@@ -115,7 +115,7 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( & pong, recv_buf, send_buf);
+ sched.make_fiber( & pong, recv_buf, send_buf, boost::fiber::default_stacksize);
for (;;)
{
Modified: sandbox/fiber/libs/fiber/examples/simple.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/examples/simple.cpp (original)
+++ sandbox/fiber/libs/fiber/examples/simple.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -23,9 +23,9 @@
{
boost::fibers::scheduler<> sched;
- boost::fiber f( fn, "abc", 5);
+ boost::fiber f( fn, "abc", 5, boost::fiber::default_stacksize);
sched.submit_fiber( boost::move( f) );
- sched.make_fiber( & fn, "xyz", 7);
+ sched.make_fiber( & fn, "xyz", 7, boost::fiber::default_stacksize);
std::cout << "start" << std::endl;
Modified: sandbox/fiber/libs/fiber/src/fiber.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/src/fiber.cpp (original)
+++ sandbox/fiber/libs/fiber/src/fiber.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -18,7 +18,7 @@
namespace boost {
namespace fibers {
-unsigned int
+std::size_t
fiber::default_stacksize = 65536;
fiber::fiber() :
Modified: sandbox/fiber/libs/fiber/test/test_at_exit.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_at_exit.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_at_exit.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -31,7 +31,7 @@
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( fn);
+ sched.make_fiber( fn, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 0), vec.size() );
BOOST_CHECK( vec.empty() );
Modified: sandbox/fiber/libs/fiber/test/test_auto_reset_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_auto_reset_event.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_auto_reset_event.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -37,11 +37,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -75,11 +77,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
Modified: sandbox/fiber/libs/fiber/test/test_barrier.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_barrier.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_barrier.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -55,8 +55,8 @@
boost::fibers::scheduler<> sched;
boost::fibers::barrier b( sched, 2);
- sched.make_fiber( fn_1, boost::ref( b) );
- sched.make_fiber( fn_2, boost::ref( b) );
+ sched.make_fiber( fn_1, boost::ref( b), boost::fiber::default_stacksize);
+ sched.make_fiber( fn_2, boost::ref( b), boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
Modified: sandbox/fiber/libs/fiber/test/test_cancel.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_cancel.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_cancel.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -53,8 +53,8 @@
boost::fibers::scheduler<> sched;
- sched.make_fiber( fn_1);
- sched.make_fiber( fn_2);
+ sched.make_fiber( fn_1, boost::fiber::default_stacksize);
+ sched.make_fiber( fn_2, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
@@ -115,9 +115,9 @@
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_2);
+ boost::fiber f( fn_2, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_3, f);
+ sched.make_fiber( fn_3, f, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value2);
BOOST_CHECK_EQUAL( 0, value3);
Modified: sandbox/fiber/libs/fiber/test/test_condition.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_condition.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_condition.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -51,7 +51,8 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
@@ -67,7 +68,8 @@
sched.make_fiber(
notify_one_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -95,12 +97,14 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
@@ -116,7 +120,8 @@
sched.make_fiber(
notify_one_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 3), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -132,7 +137,8 @@
sched.make_fiber(
notify_one_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
@@ -157,12 +163,14 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
@@ -178,7 +186,8 @@
sched.make_fiber(
notify_all_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 3), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -199,7 +208,8 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
@@ -215,7 +225,8 @@
sched.make_fiber(
notify_all_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK( sched.run() );
Modified: sandbox/fiber/libs/fiber/test/test_count_down_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_count_down_event.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_count_down_event.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -65,7 +65,8 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
ev.set();
BOOST_CHECK( sched.run() );
Modified: sandbox/fiber/libs/fiber/test/test_fiber.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_fiber.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_fiber.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -24,7 +24,7 @@
void test_case_1()
{
- boost::fiber f1( one_args_fn, 10);
+ boost::fiber f1( one_args_fn, 10, boost::fiber::default_stacksize);
boost::fiber f2;
BOOST_CHECK( f1);
BOOST_CHECK( ! f2);
@@ -34,15 +34,23 @@
void test_case_2()
{
boost::fiber f1;
- f1 = boost::fibers::make_fiber( zero_args_fn);
- boost::fiber f2 = boost::fibers::make_fiber( one_args_fn, 1);
+ f1 = boost::fibers::make_fiber( zero_args_fn, boost::fiber::default_stacksize);
+ boost::fiber f2 = boost::fibers::make_fiber( one_args_fn, 1, boost::fiber::default_stacksize);
boost::fiber f3;
- f3 = boost::fibers::make_fiber( two_args_fn, 1, "abc");
+ f3 = boost::fibers::make_fiber( two_args_fn, 1, "abc", boost::fiber::default_stacksize);
}
void test_case_3()
{
- boost::fiber f1( one_args_fn, 10);
+ boost::fiber f1( & zero_args_fn, boost::fiber::default_stacksize);
+ f1 = boost::fibers::make_fiber( zero_args_fn, boost::fiber::default_stacksize);
+ boost::fiber f2( one_args_fn, 1, boost::fiber::default_stacksize);
+ f2 = boost::fibers::make_fiber( one_args_fn, 1, boost::fiber::default_stacksize);
+}
+
+void test_case_4()
+{
+ boost::fiber f1( one_args_fn, 10, boost::fiber::default_stacksize);
BOOST_CHECK( f1);
boost::fiber f2( boost::move( f1) );
BOOST_CHECK( ! f1);
@@ -54,10 +62,10 @@
BOOST_CHECK_EQUAL( f2, f3);
}
-void test_case_4()
+void test_case_5()
{
- boost::fiber f1( zero_args_fn);
- boost::fiber f2( zero_args_fn);
+ boost::fiber f1( zero_args_fn, boost::fiber::default_stacksize);
+ boost::fiber f2( zero_args_fn, boost::fiber::default_stacksize);
boost::fiber f3;
BOOST_CHECK( f1);
BOOST_CHECK( f2);
@@ -83,10 +91,10 @@
BOOST_CHECK( os3.str() == not_a_fiber);
}
-void test_case_5()
+void test_case_6()
{
- boost::fiber f1( zero_args_fn);
- boost::fiber f2( zero_args_fn);
+ boost::fiber f1( zero_args_fn, boost::fiber::default_stacksize);
+ boost::fiber f2( zero_args_fn, boost::fiber::default_stacksize);
boost::fiber::id id1 = f1.get_id();
boost::fiber::id id2 = f2.get_id();
@@ -107,6 +115,7 @@
test->add( BOOST_TEST_CASE( & test_case_3) );
test->add( BOOST_TEST_CASE( & test_case_4) );
test->add( BOOST_TEST_CASE( & test_case_5) );
+ test->add( BOOST_TEST_CASE( & test_case_6) );
return test;
}
Modified: sandbox/fiber/libs/fiber/test/test_interrupt.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_interrupt.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_interrupt.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -87,9 +87,9 @@
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_1);
+ boost::fiber f( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_5, f);
+ sched.make_fiber( fn_5, f, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
@@ -173,9 +173,9 @@
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_2);
+ boost::fiber f( fn_2, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_5, f);
+ sched.make_fiber( fn_5, f, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
@@ -205,9 +205,9 @@
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_3);
+ boost::fiber f( fn_3, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_5, f);
+ sched.make_fiber( fn_5, f, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
Modified: sandbox/fiber/libs/fiber/test/test_join.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_join.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_join.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -68,9 +68,9 @@
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_1);
+ boost::fiber f( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_2, f);
+ sched.make_fiber( fn_2, f, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
@@ -168,10 +168,10 @@
boost::fibers::scheduler<> sched;
- boost::fiber f( fn_1);
+ boost::fiber f( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f);
- sched.make_fiber( fn_2, f);
- sched.make_fiber( fn_3, f);
+ sched.make_fiber( fn_2, f, boost::fiber::default_stacksize);
+ sched.make_fiber( fn_3, f, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
@@ -312,11 +312,11 @@
boost::fibers::scheduler<> sched;
- boost::fiber f1( fn_1);
+ boost::fiber f1( fn_1, boost::fiber::default_stacksize);
sched.submit_fiber( f1);
- boost::fiber f2( fn_2, f1);
+ boost::fiber f2( fn_2, f1, boost::fiber::default_stacksize);
sched.submit_fiber( f2);
- sched.make_fiber( fn_4, f2);
+ sched.make_fiber( fn_4, f2, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 3), sched.size() );
Modified: sandbox/fiber/libs/fiber/test/test_manual_reset_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_manual_reset_event.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_manual_reset_event.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -36,11 +36,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -66,11 +68,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -112,11 +116,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
Modified: sandbox/fiber/libs/fiber/test/test_mutex.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_mutex.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_mutex.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -55,7 +55,7 @@
void test_case1()
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( & do_test_mutex, boost::ref( sched) );
+ sched.make_fiber( & do_test_mutex, boost::ref( sched), boost::fiber::default_stacksize);
sched.run();
}
@@ -81,8 +81,8 @@
{
boost::fibers::scheduler<> sched;
boost::fibers::mutex mtx( sched);
- sched.make_fiber( & test_fn1, boost::ref( mtx) );
- sched.make_fiber( & test_fn2, boost::ref( mtx) );
+ sched.make_fiber( & test_fn1, boost::ref( mtx), boost::fiber::default_stacksize);
+ sched.make_fiber( & test_fn2, boost::ref( mtx), boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
Modified: sandbox/fiber/libs/fiber/test/test_priority.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_priority.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_priority.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -18,7 +18,7 @@
void test_case_1()
{
- boost::fiber f( zero_args_fn);
+ boost::fiber f( zero_args_fn, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, f.priority() );
f.priority( 5);
Modified: sandbox/fiber/libs/fiber/test/test_scheduler.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_scheduler.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_scheduler.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -18,6 +18,7 @@
int value3 = 0;
void zero_args_fn() {}
+void one_args_fn( int) {}
void value1_fn()
{ value1 = 1; }
@@ -32,8 +33,8 @@
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( value1_fn);
- sched.make_fiber( value2_fn);
+ sched.make_fiber( value1_fn, boost::fiber::default_stacksize);
+ sched.make_fiber( value2_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -53,8 +54,8 @@
void sched2_fn( boost::fibers::scheduler<> & sched)
{
- sched.make_fiber( value1_fn);
- sched.make_fiber( value2_fn);
+ sched.make_fiber( value1_fn, boost::fiber::default_stacksize);
+ sched.make_fiber( value2_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -74,8 +75,8 @@
void sched3_fn( boost::fibers::scheduler<> & sched)
{
- sched.make_fiber( value1_fn);
- sched.make_fiber( value2_fn);
+ sched.make_fiber( value1_fn, boost::fiber::default_stacksize);
+ sched.make_fiber( value2_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -122,6 +123,13 @@
void test_case_1()
{
+ boost::fibers::scheduler<> sched;
+ sched.make_fiber( zero_args_fn, boost::fiber::default_stacksize);
+ sched.make_fiber( one_args_fn, 1, boost::fiber::default_stacksize);
+}
+
+void test_case_2()
+{
value1 = 0;
value2 = 0;
@@ -131,7 +139,7 @@
BOOST_CHECK_EQUAL( std::size_t( 0), sched.size() );
BOOST_CHECK( ! sched.run() );
- boost::fiber f( boost::fibers::make_fiber( zero_args_fn) );
+ boost::fiber f( boost::fibers::make_fiber( zero_args_fn, boost::fiber::default_stacksize) );
BOOST_CHECK( ! f.is_alive() );
sched.submit_fiber( f);
BOOST_CHECK( f.is_alive() );
@@ -139,7 +147,7 @@
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
sched.submit_fiber(
- boost::fibers::make_fiber( zero_args_fn) );
+ boost::fibers::make_fiber( zero_args_fn, boost::fiber::default_stacksize) );
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
@@ -154,15 +162,15 @@
BOOST_CHECK( ! f.is_alive() );
}
-void test_case_2()
+void test_case_3()
{
value1 = 0;
value2 = 0;
boost::fibers::scheduler<> sched;
- sched.make_fiber( value1_fn);
- sched.make_fiber( value2_fn);
+ sched.make_fiber( value1_fn, boost::fiber::default_stacksize);
+ sched.make_fiber( value2_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -187,14 +195,14 @@
BOOST_CHECK_EQUAL( 1, value2);
}
-void test_case_3()
+void test_case_4()
{
value1 = 0;
value2 = 0;
boost::fibers::scheduler<> sched;
- sched.make_fiber( sched1_fn);
+ sched.make_fiber( sched1_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched.empty() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -213,14 +221,14 @@
BOOST_CHECK_EQUAL( 1, value2);
}
-void test_case_4()
+void test_case_5()
{
value1 = 0;
value2 = 0;
boost::fibers::scheduler<> sched1, sched2;
- sched1.make_fiber( sched2_fn, boost::ref( sched2) );
+ sched1.make_fiber( sched2_fn, boost::ref( sched2), boost::fiber::default_stacksize);
BOOST_CHECK( ! sched1.empty() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched1.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -240,7 +248,7 @@
BOOST_CHECK_EQUAL( 1, value2);
}
-void test_case_5()
+void test_case_6()
{
value1 = 0;
value2 = 0;
@@ -248,8 +256,8 @@
boost::fibers::scheduler<> sched1, sched2;
- sched1.make_fiber( sched3_fn, boost::ref( sched2) );
- sched1.make_fiber( value3_fn);
+ sched1.make_fiber( sched3_fn, boost::ref( sched2), boost::fiber::default_stacksize);
+ sched1.make_fiber( value3_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched1.empty() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched1.size() );
BOOST_CHECK_EQUAL( 0, value1);
@@ -280,17 +288,17 @@
BOOST_CHECK_EQUAL( 1, value3);
}
-void test_case_6()
+void test_case_7()
{
value1 = 0;
value2 = 0;
boost::fibers::scheduler<> sched1, sched2;
- boost::fiber f( & yield1_fn);
+ boost::fiber f( & yield1_fn, boost::fiber::default_stacksize);
boost::fiber::id id = f.get_id();
sched1.submit_fiber( f);
- sched2.make_fiber( & yield2_fn);
+ sched2.make_fiber( & yield2_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched1.empty() );
BOOST_CHECK( ! sched2.empty() );
@@ -343,17 +351,17 @@
BOOST_CHECK_EQUAL( 3, value2);
}
-void test_case_7()
+void test_case_8()
{
value1 = 0;
value2 = 0;
boost::fibers::scheduler<> sched1, sched2;
- boost::fiber f( & yield1_fn);
+ boost::fiber f( & yield1_fn, boost::fiber::default_stacksize);
boost::fiber::id id = f.get_id();
sched1.submit_fiber( f);
- sched2.make_fiber( & yield2_fn);
+ sched2.make_fiber( & yield2_fn, boost::fiber::default_stacksize);
BOOST_CHECK( ! sched1.empty() );
BOOST_CHECK( ! sched2.empty() );
@@ -418,6 +426,7 @@
test->add( BOOST_TEST_CASE( & test_case_5) );
test->add( BOOST_TEST_CASE( & test_case_6) );
test->add( BOOST_TEST_CASE( & test_case_7) );
+ test->add( BOOST_TEST_CASE( & test_case_8) );
return test;
}
Modified: sandbox/fiber/libs/fiber/test/test_spin_auto_reset_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_auto_reset_event.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_auto_reset_event.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -36,11 +36,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -74,11 +76,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
Modified: sandbox/fiber/libs/fiber/test/test_spin_barrier.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_barrier.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_barrier.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -55,8 +55,8 @@
boost::fibers::scheduler<> sched;
boost::fibers::spin::barrier b( 2);
- sched.make_fiber( fn_1, boost::ref( b) );
- sched.make_fiber( fn_2, boost::ref( b) );
+ sched.make_fiber( fn_1, boost::ref( b), boost::fiber::default_stacksize);
+ sched.make_fiber( fn_2, boost::ref( b), boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
Modified: sandbox/fiber/libs/fiber/test/test_spin_condition.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_condition.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_condition.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -50,7 +50,8 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
@@ -66,7 +67,8 @@
sched.make_fiber(
notify_one_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -91,12 +93,14 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
@@ -112,7 +116,8 @@
sched.make_fiber(
notify_one_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 3), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -145,12 +150,14 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
@@ -166,7 +173,8 @@
sched.make_fiber(
notify_all_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 3), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -187,7 +195,8 @@
sched.make_fiber(
wait_fn,
boost::ref( mtx),
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK_EQUAL( std::size_t( 1), sched.size() );
@@ -203,7 +212,8 @@
sched.make_fiber(
notify_all_fn,
- boost::ref( cond) );
+ boost::ref( cond),
+ boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
BOOST_CHECK( sched.run() );
Modified: sandbox/fiber/libs/fiber/test/test_spin_count_down_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_count_down_event.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_count_down_event.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -64,7 +64,8 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
for ( boost::uint32_t i = 0; i < n - 1; ++i)
{
Modified: sandbox/fiber/libs/fiber/test/test_spin_future.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_future.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_future.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -69,7 +69,7 @@
boost::fibers::spin::promise<int> pi2;
boost::fibers::spin::unique_future<int> fi2=pi2.get_future();
boost::fibers::scheduler<> sched;
- sched.make_fiber(set_promise_thread,&pi2);
+ sched.make_fiber(set_promise_thread,&pi2, boost::fiber::default_stacksize);
for (;;)
{
while ( sched.run() );
@@ -89,7 +89,7 @@
boost::fibers::spin::promise<int> pi3;
boost::fibers::spin::unique_future<int> fi3=pi3.get_future();
boost::fibers::scheduler<> sched;
- sched.make_fiber(set_promise_exception_thread,&pi3);
+ sched.make_fiber(set_promise_exception_thread,&pi3, boost::fiber::default_stacksize);
for (;;)
{
while ( sched.run() );
@@ -673,7 +673,7 @@
boost::fibers::spin::unique_future<int> f2(pt2.get_future());
boost::fibers::scheduler<> sched;
- sched.make_fiber(::cast_to_rval(pt));
+ sched.make_fiber(::cast_to_rval(pt), boost::fiber::default_stacksize);
for (;;)
{
while ( sched.run() );
Modified: sandbox/fiber/libs/fiber/test/test_spin_manual_reset_event.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_manual_reset_event.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_manual_reset_event.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -35,11 +35,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -65,11 +67,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
@@ -111,11 +115,13 @@
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
sched.make_fiber(
wait_fn,
- boost::ref( ev) );
+ boost::ref( ev),
+ boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( std::size_t( 2), sched.size() );
BOOST_CHECK_EQUAL( 0, value);
Modified: sandbox/fiber/libs/fiber/test/test_spin_mutex.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_spin_mutex.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_spin_mutex.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -55,7 +55,7 @@
void test_case1()
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( & do_test_spin_mutex);
+ sched.make_fiber( & do_test_spin_mutex, boost::fiber::default_stacksize);
sched.run();
}
@@ -80,8 +80,8 @@
{
boost::fibers::spin::mutex mtx;
boost::fibers::scheduler<> sched;
- sched.make_fiber( & test_fn1, boost::ref( mtx) );
- sched.make_fiber( & test_fn2, boost::ref( mtx) );
+ sched.make_fiber( & test_fn1, boost::ref( mtx), boost::fiber::default_stacksize);
+ sched.make_fiber( & test_fn2, boost::ref( mtx), boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value1);
BOOST_CHECK_EQUAL( 0, value2);
Modified: sandbox/fiber/libs/fiber/test/test_utility.cpp
==============================================================================
--- sandbox/fiber/libs/fiber/test/test_utility.cpp (original)
+++ sandbox/fiber/libs/fiber/test/test_utility.cpp 2009-12-23 18:41:30 EST (Wed, 23 Dec 2009)
@@ -50,7 +50,7 @@
void test_case_1()
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( runs_as_fn);
+ sched.make_fiber( runs_as_fn, boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
@@ -60,7 +60,7 @@
void test_case_2()
{
boost::fibers::scheduler<> sched;
- sched.make_fiber( get_id_fn);
+ sched.make_fiber( get_id_fn, boost::fiber::default_stacksize);
BOOST_CHECK( sched.run() );
@@ -72,7 +72,7 @@
{
value = 0;
boost::fibers::scheduler<> sched;
- sched.make_fiber( yield_fn, 3);
+ sched.make_fiber( yield_fn, 3, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value);
BOOST_CHECK( sched.run() );
@@ -95,7 +95,7 @@
{
value = 0;
boost::fibers::scheduler<> sched;
- sched.make_fiber( cancel_fn, 5);
+ sched.make_fiber( cancel_fn, 5, boost::fiber::default_stacksize);
BOOST_CHECK_EQUAL( 0, value);
BOOST_CHECK( sched.run() );
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