Boost C++ Libraries: Ticket #12547: yield_completion in fibers possibly destroys busy mutex https://svn.boost.org/trac10/ticket/12547 <p> Im using something similar to this page: </p> <p> <a href="http://www.boost.org/doc/libs/1_62_0/libs/fiber/doc/html/fiber/callbacks/then_there_s____boost_asio__.html">http://www.boost.org/doc/libs/1_62_0/libs/fiber/doc/html/fiber/callbacks/then_there_s____boost_asio__.html</a> </p> <p> in my project but it contains a bug. yield_completion::wait() does not reacquire the lock before returning, therefore async_result_base::get() and async_result&lt;T&gt;::get() might return before the notifying thread(calling async_handler::operator() releases the lock. with that, async_result&lt;T&gt; might be destroyed while the lock is being held by the notifying thread causing a crash. </p> <p> I assumed that the lock gets reacquired on fiber resume, but that is not the case, lk.owns_lock() is false after the suspend statement. the solution is to simply call lk.lock() after the suspend call on the context. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12547 Trac 1.4.3 Kohei Takahashi Fri, 23 Dec 2016 07:48:08 GMT owner changed https://svn.boost.org/trac10/ticket/12547#comment:1 https://svn.boost.org/trac10/ticket/12547#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">olli</span> </li> </ul> Ticket olli Thu, 06 Jul 2017 13:47:47 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/12547#comment:2 https://svn.boost.org/trac10/ticket/12547#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> should be fixed in <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/99" title="#99: Tasks: path features. (closed: Fixed)">#99</a> (<a class="ext-link" href="https://github.com/boostorg/fiber/issues/99"><span class="icon">​</span>https://github.com/boostorg/fiber/issues/99</a>) </p> Ticket