Skip to content

Commit

Permalink
Track location for atomic new/drop
Browse files Browse the repository at this point in the history
  • Loading branch information
jonhoo committed Apr 9, 2020
1 parent 93c96d5 commit c0cef54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/rt/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ impl<T: Numeric> Atomic<T> {
state.stores[index].value = T::into_u64(self.0);

if !std::thread::panicking() {
state
.unsync_mut_locations
.track(location!(), &execution.threads);
state.track_unsync_mut(&execution.threads);
}
});
Expand Down Expand Up @@ -358,6 +361,7 @@ impl State {
};

// All subsequent accesses must happen-after.
state.unsync_mut_locations.track(location, &threads);
state.track_unsync_mut(threads);

// Store the initial thread
Expand Down
8 changes: 4 additions & 4 deletions src/rt/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#[macro_use]
mod location;
pub(crate) use self::location::Location;

mod access;
use self::access::Access;

Expand All @@ -10,10 +14,6 @@ pub(crate) use self::arc::Arc;
mod atomic;
pub(crate) use self::atomic::{fence, Atomic};

#[macro_use]
mod location;
pub(crate) use self::location::Location;

mod cell;
pub(crate) use self::cell::Cell;

Expand Down

0 comments on commit c0cef54

Please sign in to comment.