Fix issue when atomic_store is called with atomic_load and
there was locks. the lock taking of atomic_load was performed within the lock of atomic_store, performing a dead lock. Fix this by perfoming an evaluation of val before setting it in atomic_store.
This commit is contained in:
1 parent
217c31d6a7
commit
2e5ca1cc1f
1 file changed
+2
-1
+2
-1
@@ -225,7 +225,8 @@ static inline long long atomic_fetch_unlock (m_mutex_t *lock, long long val)
|
||||
if ( sizeof ((ptr)->__val) <= ATOMICI_MIN_RW_SIZE) { \
|
||||
(ptr)->__val = (val); \
|
||||
} else { \
|
||||
atomic_store_lock(ptr, val); \
|
||||
long long _offset = (val) - (ptr)->__zero; \
|
||||
atomic_store_lock(ptr, (ptr)->__zero + _offset); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
Reference in new issue
Block a user