Index: future.hpp =================================================================== --- future.hpp (revision 86504) +++ future.hpp (working copy) @@ -981,7 +981,11 @@ virtual void execute(boost::unique_lock& lck) { try { - this->mark_finished_with_result_internal(func_(), lck); + Fp local_fuct=boost::move(func_); + relocker relock(lck); + Rp res = local_fuct(); + relock.lock(); + this->mark_finished_with_result_internal(boost::move(res), lck); } catch (...) { @@ -1030,7 +1034,10 @@ virtual void execute(boost::unique_lock& lck) { try { - func_(); + Fp local_fuct=boost::move(func_); + relocker relock(lck); + local_fuct(); + relock.lock(); this->mark_finished_with_result_internal(lck); } catch (...) @@ -4133,7 +4140,12 @@ virtual void execute(boost::unique_lock& lck) { try { - this->mark_finished_with_result_internal(continuation(boost::move(parent)), lck); + Fp local_fuct=boost::move(continuation); + F ftmp = boost::move(parent); + relocker relock(lck); + Rp res = local_fuct(boost::move(ftmp)); + relock.lock(); + this->mark_finished_with_result_internal(boost::move(res), lck); } catch (...) { @@ -4165,7 +4177,11 @@ virtual void execute(boost::unique_lock& lck) { try { - continuation(boost::move(parent)); + Fp local_fuct=boost::move(continuation); + F ftmp = boost::move(parent); + relocker relock(lck); + local_fuct(boost::move(ftmp)); + relock.lock(); this->mark_finished_with_result_internal(lck); } catch (...)