Remove use of deprecated compare_and_swap.

This commit is contained in:
Dario Nieuwenhuis
2020-12-30 01:06:05 +01:00
parent 015b6bbce4
commit bb6f25d010
3 changed files with 8 additions and 4 deletions

View File

@ -150,7 +150,7 @@ pub fn interrupt_take(item: TokenStream) -> TokenStream {
static TAKEN: ::core::sync::atomic::AtomicBool = ::core::sync::atomic::AtomicBool::new(false);
if TAKEN.compare_and_swap(false, true, ::core::sync::atomic::Ordering::AcqRel) {
if TAKEN.compare_exchange(false, true, ::core::sync::atomic::Ordering::AcqRel, ::core::sync::atomic::Ordering::Acquire).is_err() {
panic!("IRQ Already taken");
}