File tree Expand file tree Collapse file tree
src/engine/renderer-vulkan/Sync Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ bool AccessLock::Lock() {
4444 }
4545
4646 desired = expected + 1 ;
47- } while ( !value.compare_exchange_strong ( expected, desired, std::memory_order_acq_rel ) );
47+ } while ( !value.compare_exchange_strong ( expected, desired, std::memory_order_acquire ) );
4848
4949 return true ;
5050}
@@ -54,9 +54,9 @@ void AccessLock::Unlock() {
5454}
5555
5656bool AccessLock::LockWrite () {
57- const uint32 current = value.fetch_sub ( 1 , std::memory_order_release );
57+ const uint32 current = value.fetch_sub ( 1 , std::memory_order_relaxed );
5858
59- if ( current == 0 ) {
59+ if ( current != 1 ) {
6060 UnlockWrite ();
6161 return false ;
6262 }
@@ -71,5 +71,5 @@ void AccessLock::UnlockWrite() {
7171}
7272
7373void AccessLock::operator =( const AccessLock& other ) {
74- value = other.value .load ( std::memory_order_acquire );
74+ value = other.value .load ( std::memory_order_relaxed );
7575}
You can’t perform that action at this time.
0 commit comments