mirror of
https://github.com/boostorg/smart_ptr.git
synced 2025-07-31 05:07:21 +02:00
Revert "Use a relaxed load before XCHG to not lock cache line on contention (AMD spinlock recommendation per <https://probablydance.com/2019/12/30/measuring-mutexes-spinlocks-and-how-bad-the-linux-scheduler-really-is/>)"
This reverts commit 8afe162910
.
This commit is contained in:
@ -66,11 +66,6 @@ public:
|
|||||||
|
|
||||||
bool try_lock()
|
bool try_lock()
|
||||||
{
|
{
|
||||||
if( *const_cast< long const volatile* >( &v_ ) != 0 )
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
long r = BOOST_SP_INTERLOCKED_EXCHANGE( &v_, 1 );
|
long r = BOOST_SP_INTERLOCKED_EXCHANGE( &v_, 1 );
|
||||||
|
|
||||||
BOOST_COMPILER_FENCE
|
BOOST_COMPILER_FENCE
|
||||||
|
Reference in New Issue
Block a user