compare_and_swap -> compare_exchange

Nightly Rust (which I'm using for M1 builds) deprecates the former
so switch to the latter.
This commit is contained in:
Wez Furlong committed 2020-12-29 16:41:55 -08:00
1 parent 4e2cd574b7
commit 234fe40be6
1 file changed
+3 -1
+3 -1
View File
@@ -395,7 +395,9 @@ fn update_checker() {
pub fn start_update_checker() {
static CHECKER_STARTED: AtomicBool = AtomicBool::new(false);
if configuration().check_for_updates {
if CHECKER_STARTED.compare_and_swap(false, true, Ordering::Relaxed) == false {
if let Ok(false) =
CHECKER_STARTED.compare_exchange(false, true, Ordering::Relaxed, Ordering::Relaxed)
{
std::thread::Builder::new()
.name("update_checker".into())
.spawn(update_checker)