mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-21 22:33:49 +00:00
Remove loom
This commit is contained in:
parent
ebbbf2216b
commit
22b8e2851f
31
Cargo.lock
generated
31
Cargo.lock
generated
@ -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",
|
||||
|
@ -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"
|
||||
|
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user