mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Optimize spinlock implementation
This commit is contained in:
parent
584fd870b2
commit
0224dbc371
@ -32,10 +32,8 @@ namespace dxvk::sync {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool try_lock() {
|
bool try_lock() {
|
||||||
uint32_t expected = 0;
|
return !m_lock.load()
|
||||||
return m_lock.compare_exchange_strong(expected, 1,
|
&& !m_lock.exchange(1, std::memory_order_acquire);
|
||||||
std::memory_order_acquire,
|
|
||||||
std::memory_order_relaxed);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user