Merge branch 'phoenix' of https://github.com/InvictusInnovations/fc into phoenix
This commit is contained in:
commit
fa07ec438f
2 changed files with 18 additions and 2 deletions
|
|
@ -169,8 +169,15 @@ namespace fc {
|
||||||
public:
|
public:
|
||||||
future( const fc::shared_ptr<promise<T>>& p ):m_prom(p){}
|
future( const fc::shared_ptr<promise<T>>& p ):m_prom(p){}
|
||||||
future( fc::shared_ptr<promise<T>>&& p ):m_prom(fc::move(p)){}
|
future( fc::shared_ptr<promise<T>>&& p ):m_prom(fc::move(p)){}
|
||||||
|
future(const future<T>& f ) : m_prom(f.m_prom){}
|
||||||
future(){}
|
future(){}
|
||||||
|
|
||||||
|
future& operator=(future<T>&& f ) {
|
||||||
|
fc_swap(m_prom,f.m_prom);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
operator const T&()const { return wait(); }
|
operator const T&()const { return wait(); }
|
||||||
|
|
||||||
/// @pre valid()
|
/// @pre valid()
|
||||||
|
|
@ -219,7 +226,14 @@ namespace fc {
|
||||||
public:
|
public:
|
||||||
future( const fc::shared_ptr<promise<void>>& p ):m_prom(p){}
|
future( const fc::shared_ptr<promise<void>>& p ):m_prom(p){}
|
||||||
future( fc::shared_ptr<promise<void>>&& p ):m_prom(fc::move(p)){}
|
future( fc::shared_ptr<promise<void>>&& p ):m_prom(fc::move(p)){}
|
||||||
|
future(const future<void>& f ) : m_prom(f.m_prom){}
|
||||||
future(){}
|
future(){}
|
||||||
|
|
||||||
|
future& operator=(future<void>&& f ) {
|
||||||
|
fc_swap(m_prom,f.m_prom);
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// @pre valid()
|
/// @pre valid()
|
||||||
/// @post ready()
|
/// @post ready()
|
||||||
|
|
|
||||||
|
|
@ -217,8 +217,10 @@ namespace fc {
|
||||||
BOOST_ASSERT( this == thread::current().my );
|
BOOST_ASSERT( this == thread::current().my );
|
||||||
|
|
||||||
task_base* pending = 0;
|
task_base* pending = 0;
|
||||||
|
//DLN: changed from memory_order_consume for boost 1.55.
|
||||||
pending = task_in_queue.exchange(0,boost::memory_order_consume);
|
//This appears to be safest replacement for now, maybe
|
||||||
|
//can be changed to relaxed later, but needs analysis.
|
||||||
|
pending = task_in_queue.exchange(0,boost::memory_order_seq_cst);
|
||||||
if( pending ) { enqueue( pending ); }
|
if( pending ) { enqueue( pending ); }
|
||||||
|
|
||||||
task_base* p(0);
|
task_base* p(0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue