Boost C++ Libraries: Ticket #11362: smart_ptr spinlocks leads to livelock on ARM Cortex-A9 CPUs https://svn.boost.org/trac10/ticket/11362 <p> Spinlock used in smart_ptr for ARM architecture (smart_ptr/details/spinlock_gcc_arm.hpp) relies on swp/mcr instruction sequence or ldrex/strex/dmb depending on ARM version. Both these implementations are affected by an ARM issue described in errata 754327 for ARM Cortex-A9 CPU. </p> <p> Suggested fix is to add "dmb" instruction to change spinlock::unlock() method: </p> <blockquote> <p> void unlock() { </p> <blockquote> <p> <span class="underline">asm</span> <span class="underline">volatile</span>( BOOST_SP_ARM_BARRIER ::: "memory" ); *const_cast&lt; int volatile* &gt;( &amp;v_ ) = 0; <span class="underline">asm</span> <span class="underline">volatile</span>( BOOST_SP_ARM_BARRIER ::: "memory" ); </p> </blockquote> <p> } </p> </blockquote> <p> Second barrier was added as recommended workaround from ARM errata document. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11362 Trac 1.4.3 Peter Dimov Fri, 05 Jun 2015 22:42:34 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11362#comment:1 https://svn.boost.org/trac10/ticket/11362#comment:1 <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> In <a class="ext-link" href="https://github.com/boostorg/smart_ptr/commit/a42dda0af44727466c07e2d7fb3cfbb649b51bf2"><span class="icon">​</span>https://github.com/boostorg/smart_ptr/commit/a42dda0af44727466c07e2d7fb3cfbb649b51bf2</a>. </p> Ticket