Boost C++ Libraries: Ticket #11318: boost unique_lock has no mutex https://svn.boost.org/trac10/ticket/11318 <p> This is an issue I am observing in the newly released boost_1_58 library. I suspect the problem may not be boost related, and could be an msvc 12.0 compiler related issue. The symptom I observe is that when a Visual C++ project TURNS ON one of the compiler optimization flags /Og, /O1, /O2 or /Ox Flags, the C++ code that I am using below is throwing an exception: </p> <p> Below is the sample code I use in the application: </p> <pre class="wiki">boost::mutex::scoped_lock &lt;Scoped Lock Variable&gt; (&lt;Mutex Object&gt;) </pre><p> Below is the exception message I am seeing which strangely occurs the second time a scoped lock is called on the same valid Mutex Object within the application: </p> <p> "boost unique_lock has no mutex" </p> <p> I am baffled by what causes this problem. When I turn off the optimization flags and execute the program, the application executes flawlessly. Only when I turn on optimization flags, this error consistently occurs. Workaround I am using is to disable optimization Flags for the release version. </p> <p> Below is my build configuration: </p> <p> Visual Studio community edition 2013, which uses msvc 12 compiler version; Windows 8.1; boost Library version 1.58 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11318 Trac 1.4.3 viboes Sun, 05 Jul 2015 22:50:00 GMT status, component, description changed; owner set https://svn.boost.org/trac10/ticket/11318#comment:1 https://svn.boost.org/trac10/ticket/11318#comment:1 <ul> <li><strong>owner</strong> set 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>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">thread</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/11318?action=diff&amp;version=1">diff</a>) </li> </ul> <p> Please, could you post exactly the code as the following is not valid code </p> <pre class="wiki">boost::mutex::scoped_lock &lt;Scoped Lock Variable&gt; (&lt;Mutex Object&gt;) </pre> Ticket viboes Thu, 13 Aug 2015 06:50:11 GMT type changed https://svn.boost.org/trac10/ticket/11318#comment:2 https://svn.boost.org/trac10/ticket/11318#comment:2 <ul> <li><strong>type</strong> <span class="trac-field-old">Bugs</span> → <span class="trac-field-new">Support Requests</span> </li> </ul> Ticket viboes Sun, 11 Oct 2015 19:04:11 GMT <link>https://svn.boost.org/trac10/ticket/11318#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/11318#comment:3</guid> <description> <p> PING!!! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Sat, 17 Oct 2015 06:32:04 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/11318#comment:4 https://svn.boost.org/trac10/ticket/11318#comment:4 <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">invalid</span> </li> </ul> Ticket