Skip to content

Commit c0cef54

Browse files
committed
Track location for atomic new/drop
1 parent 93c96d5 commit c0cef54

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

src/rt/atomic.rs

+4
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ impl<T: Numeric> Atomic<T> {
313313
state.stores[index].value = T::into_u64(self.0);
314314

315315
if !std::thread::panicking() {
316+
state
317+
.unsync_mut_locations
318+
.track(location!(), &execution.threads);
316319
state.track_unsync_mut(&execution.threads);
317320
}
318321
});
@@ -358,6 +361,7 @@ impl State {
358361
};
359362

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

363367
// Store the initial thread

src/rt/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#[macro_use]
2+
mod location;
3+
pub(crate) use self::location::Location;
4+
15
mod access;
26
use self::access::Access;
37

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

13-
#[macro_use]
14-
mod location;
15-
pub(crate) use self::location::Location;
16-
1717
mod cell;
1818
pub(crate) use self::cell::Cell;
1919

0 commit comments

Comments
 (0)