Skip to content

Commit

Permalink
Implement RefUnwindSafe for Atomic (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
sarsko authored Mar 2, 2024
1 parent c327892 commit 29c782f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/sync/atomic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ use crate::runtime::execution::ExecutionState;
use crate::runtime::task::clock::VectorClock;
use crate::runtime::thread;
use std::cell::RefCell;
use std::panic::RefUnwindSafe;

static PRINTED_ORDERING_WARNING: std::sync::atomic::AtomicBool = std::sync::atomic::AtomicBool::new(false);

Expand Down Expand Up @@ -123,6 +124,7 @@ struct Atomic<T> {
// Safety: Atomic is never actually passed across true threads, only across continuations. The
// RefCell<_> type therefore can't be preempted mid-bookkeeping-operation.
unsafe impl<T: Sync> Sync for Atomic<T> {}
impl<T: RefUnwindSafe> RefUnwindSafe for Atomic<T> {}

impl<T> Atomic<T> {
const fn new(v: T) -> Self {
Expand Down

0 comments on commit 29c782f

Please sign in to comment.