From 8e47816c4ebc4ef1cbcbea60139c2795a73871e5 Mon Sep 17 00:00:00 2001 From: dnotestein Date: Thu, 12 Dec 2013 09:19:15 -0500 Subject: [PATCH 1/3] Fix for problem reported with Boost 1.55 (memory_order_consume removed?). Also added move constructors for future, this second change probably needs review. --- include/fc/thread/future.hpp | 12 ++++++++++++ src/thread/thread_d.hpp | 6 ++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp index 85bdbd4..d8d157d 100644 --- a/include/fc/thread/future.hpp +++ b/include/fc/thread/future.hpp @@ -171,6 +171,12 @@ namespace fc { future( fc::shared_ptr>&& p ):m_prom(fc::move(p)){} future(){} + future& operator=(future&& 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>& p ):m_prom(p){} future( fc::shared_ptr>&& p ):m_prom(fc::move(p)){} future(){} + + future& operator=(future&& f ) { + fc_swap(m_prom,f.m_prom); + return *this; + } + /// @pre valid() /// @post ready() diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp index 8f5237f..bac4aa0 100644 --- a/src/thread/thread_d.hpp +++ b/src/thread/thread_d.hpp @@ -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); From 2d0bdb8e7ab43cbc037d1e54f8c105d9ef0b5f64 Mon Sep 17 00:00:00 2001 From: dnotestein Date: Thu, 12 Dec 2013 22:18:09 -0500 Subject: [PATCH 2/3] attempt to fix Linux compile error, needs to be verified on a Linux build machine --- include/fc/thread/future.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp index d8d157d..d2deb76 100644 --- a/include/fc/thread/future.hpp +++ b/include/fc/thread/future.hpp @@ -169,6 +169,7 @@ namespace fc { public: future( const fc::shared_ptr>& p ):m_prom(p){} future( fc::shared_ptr>&& p ):m_prom(fc::move(p)){} + future(const future& f ) : m_prom(f.m_prom){} future(){} future& operator=(future&& f ) { From d1d365beaf9d2a00752878b9e392792f5933c0f7 Mon Sep 17 00:00:00 2001 From: dnotestein Date: Fri, 13 Dec 2013 09:13:08 -0500 Subject: [PATCH 3/3] further attempt at fixing Linux compile error --- include/fc/thread/future.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/fc/thread/future.hpp b/include/fc/thread/future.hpp index d2deb76..cf57a24 100644 --- a/include/fc/thread/future.hpp +++ b/include/fc/thread/future.hpp @@ -226,6 +226,7 @@ namespace fc { public: future( const fc::shared_ptr>& p ):m_prom(p){} future( fc::shared_ptr>&& p ):m_prom(fc::move(p)){} + future(const future& f ) : m_prom(f.m_prom){} future(){} future& operator=(future&& f ) {