Merge branch 'phoenix' of https://github.com/InvictusInnovations/fc into phoenix

This commit is contained in:
vogel76 2013-12-12 16:07:07 +01:00
commit 8cb21e26db
2 changed files with 16 additions and 2 deletions

View file

@ -171,6 +171,12 @@ namespace fc {
future( fc::shared_ptr<promise<T>>&& p ):m_prom(fc::move(p)){}
future(){}
future& operator=(future<T>&& f ) {
fc_swap(m_prom,f.m_prom);
return *this;
}
operator const T&()const { return wait(); }
/// @pre valid()
@ -220,6 +226,12 @@ namespace fc {
future( const fc::shared_ptr<promise<void>>& p ):m_prom(p){}
future( fc::shared_ptr<promise<void>>&& p ):m_prom(fc::move(p)){}
future(){}
future& operator=(future<void>&& f ) {
fc_swap(m_prom,f.m_prom);
return *this;
}
/// @pre valid()
/// @post ready()

View file

@ -217,8 +217,10 @@ namespace fc {
BOOST_ASSERT( this == thread::current().my );
task_base* pending = 0;
pending = task_in_queue.exchange(0,boost::memory_order_consume);
//DLN: changed from memory_order_consume for boost 1.55.
//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 ); }
task_base* p(0);