| /external/rust/crates/tokio/src/runtime/tests/ |
| D | loom_multi_thread_alt.rs | 5 /// Full runtime loom tests. These are heavy tests and take significant time to 8 /// Use `LOOM_MAX_PREEMPTIONS=1` to do a "quick" run as a smoke test. 17 use loom::sync::atomic::{AtomicBool, AtomicUsize}; 18 use loom::sync::Arc; 27 use loom::sync::atomic::AtomicBool; 37 pub(super) fn new(value: T) -> Self { in new() 44 pub(super) fn take(&self) -> Option<T> { in take() 66 fn new(sender: oneshot::Sender<T>) -> Self { in new() 81 #[test] 83 loom::model(|| { in racy_shutdown() [all …]
|
| D | loom_multi_thread.rs | 5 /// Full runtime loom tests. These are heavy tests and take significant time to 8 /// Use `LOOM_MAX_PREEMPTIONS=1` to do a "quick" run as a smoke test. 17 use loom::sync::atomic::{AtomicBool, AtomicUsize}; 18 use loom::sync::Arc; 27 use loom::sync::atomic::AtomicBool; 37 pub(super) fn new(value: T) -> Self { in new() 44 pub(super) fn take(&self) -> Option<T> { in take() 66 fn new(sender: oneshot::Sender<T>) -> Self { in new() 81 #[test] 83 loom::model(|| { in racy_shutdown() [all …]
|
| D | loom_blocking.rs | 5 #[test] 7 loom::model(|| { in blocking_shutdown() 26 #[test] 29 loom::model(|| { in spawn_mandatory_blocking_should_always_run() 47 #[test] 50 loom::model(|| { in spawn_mandatory_blocking_should_run_even_when_shutting_down_from_other_thread() 56 loom::thread::spawn(move || { in spawn_mandatory_blocking_should_run_even_when_shutting_down_from_other_thread() 76 #[test] 79 loom::model(|| { in spawn_blocking_when_paused() 97 fn mk_runtime(num_threads: usize) -> Runtime { in mk_runtime()
|
| /external/rust/crates/sharded-slab/src/tests/ |
| D | mod.rs | 10 #[test] 11 #[cfg_attr(loom, ignore)] 18 #[test] 19 #[cfg_attr(loom, ignore)] 37 #[cfg(loom)] 45 #[cfg(loom)] 47 run_builder(name, loom::model::Builder::new(), f) in run_model() 50 #[cfg(loom)] 53 builder: loom::model::Builder, in run_builder() 59 "\n------------ running test {}; iteration {} ------------\n", in run_builder() [all …]
|
| /external/rust/crates/oneshot-uniffi/tests/helpers/ |
| D | mod.rs | 5 #[cfg(not(loom))] 7 #[cfg(not(loom))] 9 #[cfg(loom)] 10 use loom::sync::{ 15 #[cfg(loom)] 18 pub fn maybe_loom_model(test: impl Fn() + Sync + Send + 'static) { in maybe_loom_model() 19 #[cfg(loom)] in maybe_loom_model() 20 loom::model(test); in maybe_loom_model() 21 #[cfg(not(loom))] in maybe_loom_model() 22 test(); in maybe_loom_model() [all …]
|
| /external/rust/crates/tokio/src/runtime/time/tests/ |
| D | mod.rs | 5 #[cfg(not(loom))] 8 use crate::loom::sync::atomic::{AtomicBool, Ordering}; 9 use crate::loom::sync::Arc; 10 use crate::loom::thread; 14 fn block_on<T>(f: impl std::future::Future<Output = T>) -> T { in block_on() 15 #[cfg(loom)] in block_on() 16 return loom::future::block_on(f); in block_on() 18 #[cfg(not(loom))] in block_on() 28 #[cfg(loom)] in model() 29 loom::model(f); in model() [all …]
|
| /external/rust/crates/tokio/src/sync/tests/ |
| D | loom_semaphore_batch.rs | 4 use loom::future::block_on; 5 use loom::sync::atomic::AtomicUsize; 6 use loom::thread; 14 #[test] 26 assert!(actual <= NUM - 1); in basic_usage() 33 loom::model(|| { in basic_usage() 51 #[test] 53 loom::model(|| { in release() 70 #[test] 74 loom::model(|| { in basic_closing() [all …]
|
| D | loom_oneshot.rs | 4 use loom::future::block_on; 5 use loom::thread; 8 #[test] 10 loom::model(|| { in smoke() 22 #[test] 24 loom::model(|| { in changing_rx_task() 58 #[test] 60 // reproduces https://github.com/tokio-rs/tokio/issues/4225 in try_recv_close() 61 loom::model(|| { in try_recv_close() 72 #[test] [all …]
|
| /external/rust/crates/bytes/.github/workflows/ |
| D | ci.yml | 6 - master 9 - master 12 RUSTFLAGS: -Dwarnings 14 nightly: nightly-2022-11-12 24 runs-on: ubuntu-latest 26 - uses: actions/checkout@v3 27 - name: Install Rust 29 - name: Check formatting 30 run: cargo fmt --all -- --check 36 # runs-on: ubuntu-latest [all …]
|
| /external/rust/crates/tokio/src/macros/ |
| D | cfg.rs | 16 /// Enables Windows-specific code. 28 /// Enables unstable Windows-specific code. 47 feature = "io-std", 66 #[cfg(not(loom))] 98 feature = "io-std", 161 #[cfg(feature = "io-std")] 162 #[cfg_attr(docsrs, doc(cfg(feature = "io-std")))] 171 #[cfg(feature = "io-util")] 172 #[cfg_attr(docsrs, doc(cfg(feature = "io-util")))] 180 $( #[cfg(not(feature = "io-util"))] $item )* [all …]
|
| /external/rust/crates/crossbeam-epoch/tests/ |
| D | loom.rs | 4 use loom_crate as loom; 8 use loom::sync::atomic::Ordering::{self, Acquire, Relaxed, Release}; 9 use loom::sync::Arc; 10 use loom::thread::spawn; 14 #[test] 16 loom::model(|| { in it_works() 23 let jh = loom::thread::spawn(move || { in it_works() 27 // value, but in this limited test scenario it's okay, since we know the test won't in it_works() 48 #[test] 50 /// Treiber's lock-free stack. in treiber_stack() [all …]
|
| /external/rust/crates/sharded-slab/src/ |
| D | sync.rs | 3 #[cfg(all(loom, any(test, feature = "loom")))] 6 pub use loom::sync::atomic::*; 9 pub(crate) use loom::{ 15 use loom::alloc; 19 /// This is a version of `loom::alloc::Track` that adds a missing 26 pub fn new(value: T) -> Track<T> { in new() 32 pub fn get_ref(&self) -> &T { in get_ref() 38 pub fn get_mut(&mut self) -> &mut T { in get_mut() 44 pub fn into_inner(self) -> T { in into_inner() 50 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() [all …]
|
| D | tid.rs | 51 fn as_usize(&self) -> usize { in as_usize() 56 fn from_usize(id: usize) -> Self { in from_usize() 67 pub(crate) fn current() -> Self { in current() 73 pub(crate) fn is_current(self) -> bool { in is_current() 80 pub fn new(id: usize) -> Self { in new() 87 fn poisoned() -> Self { in poisoned() 96 pub(crate) fn is_poisoned(&self) -> bool { in is_poisoned() 102 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { in fmt() 116 fn eq(&self, other: &Self) -> bool { in eq() 124 fn clone(&self) -> Self { in clone() [all …]
|
| /external/rust/crates/sharded-slab/.github/workflows/ |
| D | ci.yml | 9 RUSTFLAGS: -Dwarnings 16 runs-on: ubuntu-latest 20 - x86_64-unknown-linux-gnu 21 - i686-unknown-linux-musl 23 - uses: actions/checkout@master 24 - name: Install toolchain 25 uses: actions-rs/toolchain@v1 31 - name: cargo build --target ${{ matrix.target }} 32 uses: actions-rs/cargo@v1 35 args: --all-targets --target ${{ matrix.target }} [all …]
|
| /external/rust/crates/oneshot-uniffi/.github/workflows/ |
| D | build-and-test.yml | 1 name: Cargo build and test 5 RUSTFLAGS: "--deny warnings " 7 build-and-test: 10 os: [ubuntu-latest, macos-latest, windows-latest] 13 - os: ubuntu-latest 15 - os: ubuntu-latest 17 runs-on: ubuntu-latest 19 - name: Checkout repository 22 - name: Install Rust 23 uses: ATiltedTree/setup-rust@v1.0.4 [all …]
|
| /external/rust/crates/tokio/src/runtime/tests/loom_multi_thread/ |
| D | yield_now.rs | 5 #[test] 8 let mut loom = loom::model::Builder::default(); in yield_calls_park_before_scheduling_again() localVariable 9 loom.max_permutations = Some(1); in yield_calls_park_before_scheduling_again() 10 loom.check(|| { in yield_calls_park_before_scheduling_again() 15 let tid = loom::thread::current().id(); in yield_calls_park_before_scheduling_again() 20 if tid == loom::thread::current().id() { in yield_calls_park_before_scheduling_again() 32 fn mk_runtime(num_threads: usize) -> Runtime { in mk_runtime()
|
| D | queue.rs | 4 use loom::thread; 7 fn new_stats() -> Stats { in new_stats() 11 #[test] 13 loom::model(|| { in basic() 65 #[test] 67 loom::model(|| { in steal_overflow() 115 #[test] 119 fn steal_tasks(steal: queue::Steal<NoopSchedule>) -> usize { in multi_stealer() 136 loom::model(|| { in multi_stealer() 169 #[test] [all …]
|
| /external/rust/crates/tokio/src/runtime/tests/loom_multi_thread_alt/ |
| D | yield_now.rs | 5 #[test] 8 let mut loom = loom::model::Builder::default(); in yield_calls_park_before_scheduling_again() localVariable 9 loom.max_permutations = Some(1); in yield_calls_park_before_scheduling_again() 10 loom.check(|| { in yield_calls_park_before_scheduling_again() 15 let tid = loom::thread::current().id(); in yield_calls_park_before_scheduling_again() 20 if tid == loom::thread::current().id() { in yield_calls_park_before_scheduling_again() 32 fn mk_runtime(num_threads: usize) -> Runtime { in mk_runtime()
|
| D | queue.rs | 4 use loom::thread; 7 fn new_stats() -> Stats { in new_stats() 11 #[test] 13 loom::model(|| { in basic() 65 #[test] 67 loom::model(|| { in steal_overflow() 115 #[test] 119 fn steal_tasks(steal: queue::Steal<NoopSchedule>) -> usize { in multi_stealer() 136 loom::model(|| { in multi_stealer() 169 #[test] [all …]
|
| /external/rust/crates/tokio/src/runtime/tests/loom_current_thread/ |
| D | yield_now.rs | 5 #[test] 8 let mut loom = loom::model::Builder::default(); in yield_calls_park_before_scheduling_again() localVariable 9 loom.max_permutations = Some(1); in yield_calls_park_before_scheduling_again() 10 loom.check(|| { in yield_calls_park_before_scheduling_again() 15 let tid = loom::thread::current().id(); in yield_calls_park_before_scheduling_again() 20 if tid == loom::thread::current().id() { in yield_calls_park_before_scheduling_again() 32 fn mk_runtime(num_threads: usize) -> Runtime { in mk_runtime()
|
| /external/rust/crates/sharded-slab/bin/ |
| D | loom.sh | 2 # Runs Loom tests with defaults for Loom's configuration values. 7 # Any arguments to this script are passed to the `cargo test` invocation. 9 RUSTFLAGS="${RUSTFLAGS} --cfg loom -C debug-assertions=on" \ 10 LOOM_MAX_PREEMPTIONS="${LOOM_MAX_PREEMPTIONS:-2}" \ 11 LOOM_CHECKPOINT_INTERVAL="${LOOM_CHECKPOINT_INTERVAL:-1}" \ 14 cargo test --release --lib "$@"
|
| /external/rust/crates/tokio/src/util/ |
| D | rc_cell.rs | 1 use crate::loom::cell::UnsafeCell; 12 #[cfg(not(all(loom, test)))] 13 pub(crate) const fn new() -> Self { in new() 19 // The UnsafeCell in loom does not have a const `new` fn. 20 #[cfg(all(loom, test))] 21 pub(crate) fn new() -> Self { in new() 29 unsafe fn with_inner<F, R>(&self, f: F) -> R in with_inner() 31 F: FnOnce(&mut Option<Rc<T>>) -> R, in with_inner() 41 pub(crate) fn get(&self) -> Option<Rc<T>> { in get() 42 // safety: The `Rc::clone` method will not call any unknown user-code, in get() [all …]
|
| /external/rust/crates/crossbeam-epoch/src/ |
| D | lib.rs | 1 //! Epoch-based memory reclamation. 4 //! Suppose that a thread removes an element from a lock-free map, while another thread is reading 18 //! That is the general mechanism behind epoch-based memory reclamation, but the details are a bit 25 //! is just a shared atomic pointer to a heap-allocated object. Loading an [`Atomic`] yields a 26 //! [`Shared`], which is an epoch-protected pointer through which the loaded object can be safely 39 //! pinned participants get unpinned. Such objects can be stored into a thread-local or global 51 #![doc(test( 67 extern crate loom_crate as loom; 73 pub(crate) use loom::cell::UnsafeCell; 77 pub(crate) use loom::sync::atomic::{fence, AtomicPtr, AtomicUsize, Ordering}; [all …]
|
| /external/rust/crates/bytes/src/ |
| D | loom.rs | 1 #[cfg(not(all(test, loom)))] 7 fn with_mut<F, R>(&mut self, f: F) -> R in with_mut() 9 F: FnOnce(&mut *mut T) -> R; in with_mut() 13 fn with_mut<F, R>(&mut self, f: F) -> R in with_mut() 15 F: FnOnce(&mut *mut T) -> R, in with_mut() 23 #[cfg(all(test, loom))] 26 pub(crate) use loom::sync::atomic::{AtomicPtr, AtomicUsize, Ordering};
|
| /external/rust/crates/crossbeam-utils/src/ |
| D | lib.rs | 5 //! * [`AtomicCell`], a thread-safe mutable memory location. 11 //! * [`ShardedLock`], a sharded reader-writer lock with fast concurrent reads. 27 #![doc(test( 46 pub(crate) use loom::hint::spin_loop; 50 pub(crate) use loom::sync::atomic::{ 55 // FIXME: loom does not support compiler_fence at the moment. 56 // https://github.com/tokio-rs/loom/issues/117 57 // we use fence as a stand-in for compiler_fence for the time being. 60 pub(crate) use loom::sync::atomic::fence as compiler_fence; 62 pub(crate) use loom::sync::{Arc, Condvar, Mutex};
|