Boost C++ Libraries: Ticket #8671: promise: set_..._at_thread_exit https://svn.boost.org/trac10/ticket/8671 <p> ~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. </p> <pre class="wiki">Index: future.hpp =================================================================== --- future.hpp (revision 84678) +++ future.hpp (working copy) @@ -443,6 +443,7 @@ throw_exception(promise_already_satisfied()); } exception=e; + this-&gt;is_constructed = true; get_current_thread_data()-&gt;make_ready_at_thread_exit(shared_from_this()); } bool has_value() @@ -1746,7 +1747,7 @@ { boost::unique_lock&lt;boost::mutex&gt; lock(future_-&gt;mutex); - if(!future_-&gt;done) + if(!future_-&gt;done &amp;&amp; !future_-&gt;is_constructed) { future_-&gt;mark_exceptional_finish_internal(boost::copy_exception(broken_promise()), lock); } @@ -1915,7 +1916,7 @@ { boost::unique_lock&lt;boost::mutex&gt; lock(future_-&gt;mutex); - if(!future_-&gt;done) + if(!future_-&gt;done &amp;&amp; !future_-&gt;is_constructed) { future_-&gt;mark_exceptional_finish_internal(boost::copy_exception(broken_promise()), lock); } @@ -2057,7 +2058,7 @@ { boost::unique_lock&lt;boost::mutex&gt; lock(future_-&gt;mutex); - if(!future_-&gt;done) + if(!future_-&gt;done &amp;&amp; !future_-&gt;is_constructed) { future_-&gt;mark_exceptional_finish_internal(boost::copy_exception(broken_promise()), lock); } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8671 Trac 1.4.3 viboes Sat, 08 Jun 2013 05:53:39 GMT owner, status, milestone changed https://svn.boost.org/trac10/ticket/8671#comment:1 https://svn.boost.org/trac10/ticket/8671#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.54.0</span> </li> </ul> Ticket viboes Sun, 09 Jun 2013 17:18:16 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8671#comment:2 https://svn.boost.org/trac10/ticket/8671#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/84717" title="Thread: fix #8550, #8671, #8672.">[84717]</a>) Thread: fix <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8550" title="#8550: Patches: [Boost.Thread] static linking of Boost.Thread with an MFC-Dll (closed: fixed)">#8550</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8671" title="#8671: Bugs: promise: set_..._at_thread_exit (closed: fixed)">#8671</a>, <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/8672" title="#8672: Bugs: future&lt;&gt;::then(void()) doesn't works (closed: fixed)">#8672</a>. </p> Ticket