Subject: [Boost-bugs] [Boost C++ Libraries] #8671: promise: set_..._at_thread_exit
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-08 05:53:11
#8671: promise: set_..._at_thread_exit
------------------------------+----------------------
Reporter: viboes | Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.53.0 | Severity: Problem
Keywords: |
------------------------------+----------------------
~promise needs to check if the promise shared state will be set at thread
exit and set_exception_and_thread_exit needs to set this state.
{{{
Index: future.hpp
===================================================================
--- future.hpp (revision 84678)
+++ future.hpp (working copy)
@@ -443,6 +443,7 @@
throw_exception(promise_already_satisfied());
}
exception=e;
+ this->is_constructed = true;
get_current_thread_data()->make_ready_at_thread_exit(shared_from_this());
}
bool has_value()
@@ -1746,7 +1747,7 @@
{
boost::unique_lock<boost::mutex> lock(future_->mutex);
- if(!future_->done)
+ if(!future_->done && !future_->is_constructed)
{
future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()),
lock);
}
@@ -1915,7 +1916,7 @@
{
boost::unique_lock<boost::mutex> lock(future_->mutex);
- if(!future_->done)
+ if(!future_->done && !future_->is_constructed)
{
future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()),
lock);
}
@@ -2057,7 +2058,7 @@
{
boost::unique_lock<boost::mutex> lock(future_->mutex);
- if(!future_->done)
+ if(!future_->done && !future_->is_constructed)
{
future_->mark_exceptional_finish_internal(boost::copy_exception(broken_promise()),
lock);
}
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8671> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC