forked from wvwwvwwv/scalable-concurrent-containers
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(ebr, wvwwvwwv#133): add
loom
-based tests
- Loading branch information
Showing
10 changed files
with
178 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#![allow(unused_imports)] | ||
pub(crate) use self::inner::*; | ||
|
||
#[cfg(all(test, loom))] | ||
mod inner { | ||
pub(crate) mod atomic { | ||
pub use loom::sync::atomic::*; | ||
pub use std::sync::atomic::Ordering; | ||
|
||
// FIXME: loom does not support compiler_fence at the moment. | ||
// https://github.com/tokio-rs/loom/issues/117 | ||
// we use fence as a stand-in for compiler_fence for the time being. | ||
// this may miss some races since fence is stronger than compiler_fence, | ||
// but it's the best we can do for the time being. | ||
pub(crate) use self::fence as compiler_fence; | ||
} | ||
pub(crate) use loom::{ | ||
cell::UnsafeCell, hint, lazy_static, sync::Mutex, thread::yield_now, thread_local, | ||
}; | ||
} | ||
|
||
#[cfg(not(all(loom, test)))] | ||
mod inner { | ||
pub(crate) use std::{ | ||
cell::UnsafeCell, | ||
sync::{atomic, Mutex}, | ||
thread::yield_now, | ||
thread_local, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod correctness; | ||
mod loom; | ||
mod model; | ||
mod performance; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#[cfg(all(test, loom))] | ||
mod loom_tests { | ||
#[test] | ||
fn it_works() {} | ||
|
||
#[test] | ||
fn treiber_stack() {} | ||
} |
Oops, something went wrong.