mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-10 18:11:04 +09:00
strong, mb
This commit is contained in:
parent
dd777209e4
commit
8203480e3c
2 changed files with 2 additions and 2 deletions
|
@ -138,7 +138,7 @@ private:
|
|||
// will do a lot less attempts than an simple retry. On multiprocessor machine fruitless attempts
|
||||
// will cause unnecessary sharing of the contended state which may make modifying the state more expensive.
|
||||
// To protect against degenerate cases we will cap the per-iteration wait to 1024 spinwaits.
|
||||
static const uint32_t MaxExponentialBackoffBits = 16;
|
||||
static const uint32_t MaxExponentialBackoffBits = 10;
|
||||
|
||||
// This lock is unfair and permits acquiring a contended lock by a nonwaiter in the presence of waiters.
|
||||
// It is possible for one thread to keep holding the lock long enough that waiters go to sleep and
|
||||
|
|
|
@ -43,7 +43,7 @@ FORCEINLINE uint8_t Cas128(int64_t volatile *pDst, int64_t iValueHigh, int64_t i
|
|||
FORCEINLINE uint8_t Cas128(int64_t volatile *pDst, int64_t iValueHigh, int64_t iValueLow, int64_t *pComparandAndResult)
|
||||
{
|
||||
__int128_t iValue = ((__int128_t)iValueHigh << 64) + (uint64_t)iValueLow;
|
||||
return __atomic_compare_exchange_n ((__int128_t*)pDst, (__int128_t*)pComparandAndResult, iValue, /*weak*/ true, /* success_memorder */ __ATOMIC_SEQ_CST, /* failure_memorder */ __ATOMIC_RELAXED);
|
||||
return __atomic_compare_exchange_n ((__int128_t*)pDst, (__int128_t*)pComparandAndResult, iValue, /*weak*/ false, /* success_memorder */ __ATOMIC_SEQ_CST, /* failure_memorder */ __ATOMIC_SEQ_CST);
|
||||
}
|
||||
#pragma clang diagnostic pop
|
||||
#endif // HOST_AMD64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue