mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-27 13:28:28 +00:00
Use compare_exchange and not compare_and_swap
This commit is contained in:
parent
eada611c2c
commit
65bfc1469e
@ -199,7 +199,11 @@ fn check_multiple_winits() {
|
|||||||
// Note that the `Ordering` basically doesn't matter here, but even if it
|
// Note that the `Ordering` basically doesn't matter here, but even if it
|
||||||
// did, `Relaxed` is still correct because we're only interested in the
|
// did, `Relaxed` is still correct because we're only interested in the
|
||||||
// effects on a single atomic variable.
|
// effects on a single atomic variable.
|
||||||
if winits_enabled <= 1 || COMPLAINED.compare_and_swap(false, true, Ordering::Relaxed) {
|
if winits_enabled <= 1
|
||||||
|
|| COMPLAINED
|
||||||
|
.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
|
||||||
|
.is_err()
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let mut err = Vec::with_capacity(512);
|
let mut err = Vec::with_capacity(512);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user