Remove loom

This commit is contained in:
Connor Fitzgerald 2021-06-19 23:33:41 -04:00
parent ebbbf2216b
commit 22b8e2851f
3 changed files with 0 additions and 59 deletions

31
Cargo.lock generated
View File

@ -664,19 +664,6 @@ dependencies = [
"byteorder",
]
[[package]]
name = "generator"
version = "0.6.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "061d3be1afec479d56fa3bd182bf966c7999ec175fcfdb87ac14d417241366c6"
dependencies = [
"cc",
"libc",
"log",
"rustversion",
"winapi 0.3.9",
]
[[package]]
name = "getrandom"
version = "0.1.16"
@ -915,17 +902,6 @@ dependencies = [
"cfg-if 1.0.0",
]
[[package]]
name = "loom"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a0e8460f2f2121162705187214720353c517b97bdfb3494c0b1e33d83ebe4bed"
dependencies = [
"cfg-if 0.1.10",
"generator",
"scoped-tls",
]
[[package]]
name = "malloc_buf"
version = "0.0.6"
@ -1557,12 +1533,6 @@ dependencies = [
"owned_ttf_parser",
]
[[package]]
name = "rustversion"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088"
[[package]]
name = "same-file"
version = "1.0.6"
@ -1962,7 +1932,6 @@ dependencies = [
"copyless",
"fxhash",
"log",
"loom",
"naga",
"parking_lot",
"profiling",

View File

@ -59,8 +59,5 @@ hal = { path = "../wgpu-hal", package = "wgpu-hal", features = ["vulkan"] }
[target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies]
hal = { path = "../wgpu-hal", package = "wgpu-hal", features = ["vulkan"] }
[dev-dependencies]
loom = "0.3"
[build-dependencies]
cfg_aliases = "0.1"

View File

@ -43,9 +43,6 @@ mod validation;
pub use hal::api;
#[cfg(test)]
use loom::sync::atomic;
#[cfg(not(test))]
use std::sync::atomic;
use atomic::{AtomicU64, AtomicUsize, Ordering};
@ -124,28 +121,6 @@ impl Drop for RefCount {
}
}
#[cfg(test)]
#[test]
fn loom() {
loom::model(move || {
let bx = Box::new(AtomicUsize::new(1));
let ref_count_main = ptr::NonNull::new(Box::into_raw(bx)).map(RefCount).unwrap();
let ref_count_spawned = ref_count_main.clone();
let join_handle = loom::thread::spawn(move || {
let _ = ref_count_spawned.clone();
ref_count_spawned.rich_drop_outer()
});
let dropped_in_main = ref_count_main.rich_drop_outer();
let dropped_in_spawned = join_handle.join().unwrap();
assert_ne!(
dropped_in_main, dropped_in_spawned,
"must drop exactly once"
);
});
}
/// Reference count object that tracks multiple references.
/// Unlike `RefCount`, it's manually inc()/dec() called.
#[derive(Debug)]