Searched refs:get_or_init (Results 1 - 10 of 10) sorted by relevance
/third_party/rust/crates/once_cell/tests/ |
H A D | it.rs | 13 c.get_or_init(|| 92); in once_cell() 16 c.get_or_init(|| panic!("Kabom!")); in once_cell() 47 x.get_or_init(|| Dropper); in once_cell_drop() 233 x.get_or_init(|| { in reentrant_init() 234 let r = x.get_or_init(|| Box::new(92)); in reentrant_init() 272 c.get_or_init(|| 92); in once_cell() 277 c.get_or_init(|| panic!("Kabom!")); in once_cell() 318 x.get_or_init(|| Dropper); in once_cell_drop() 389 let j = if t % 2 == 0 { s.wait() } else { s.get_or_init(|| i) }; in get_or_init_stress() 474 x.get_or_init(|| { in reentrant_init() [all...] |
/third_party/rust/crates/once_cell/examples/ |
H A D | test_synchronization.rs | 20 CELLS.get_or_init(|| vec![OnceCell::new(); N_ROUNDS]); in main() 34 let &value = cell.get_or_init(|| i); in thread_main() 37 assert_eq!(RESULT.get_or_init(|| accum), &accum); in thread_main()
|
H A D | reentrant_init_deadlocks.rs | 3 cell.get_or_init(|| { in main() 4 cell.get_or_init(|| 1); in main()
|
H A D | lazy_static.rs | 17 INSTANCE.get_or_init(|| { in hashmap()
|
H A D | bench.rs | 25 let &value = CELL.get_or_init(|| i); in thread_main()
|
H A D | bench_acquire.rs | 32 let _value = CELL.get_or_init(|| i + 1); in thread_main()
|
H A D | regex.rs | 8 RE.get_or_init(|| regex::Regex::new($re).unwrap())
|
/third_party/rust/crates/once_cell/src/ |
H A D | race.rs | 14 //! it allows them to be certain that after `get` or `get_or_init` returns on 16 //! calling `set` or `get_or_init` will be made visible to that thread; without 69 /// If several threads concurrently run `get_or_init`, more than one `f` can 72 pub fn get_or_init<F>(&self, f: F) -> NonZeroUsize in get_or_init() functions 87 /// If several threads concurrently run `get_or_init`, more than one `f` can 142 /// If several threads concurrently run `get_or_init`, more than one `f` can 145 pub fn get_or_init<F>(&self, f: F) -> bool in get_or_init() functions 149 OnceBool::from_usize(self.inner.get_or_init(|| OnceBool::to_usize(f()))) in get_or_init() 156 /// If several threads concurrently run `get_or_init`, more than one `f` can 221 /// If several threads concurrently run `get_or_init`, mor 224 pub fn get_or_init<F>(&self, f: F) -> &'a T get_or_init() functions 344 pub fn get_or_init<F>(&self, f: F) -> &T get_or_init() functions [all...] |
H A D | lib.rs | 73 //! INSTANCE.get_or_init(|| { 154 //! RE.get_or_init(|| regex::Regex::new($re).unwrap()) 182 //! self.cell.get_or_init(|| { 265 //! Technically, calling `get_or_init` will also cause a panic or a deadlock if it recursively calls 378 /// let value: &String = cell.get_or_init(|| { 551 /// let value = cell.get_or_init(|| 92); 553 /// let value = cell.get_or_init(|| unreachable!()); 556 pub fn get_or_init<F>(&self, f: F) -> &T in get_or_init() functions 744 this.cell.get_or_init(|| match this.init.take() { in force() 844 /// thread A initializes the cell with `get_or_init( 1080 pub fn get_or_init<F>(&self, f: F) -> &T get_or_init() functions [all...] |
/third_party/rust/crates/cxx/gen/build/src/ |
H A D | cargo.rs | 19 let env = ENV.get_or_init(CargoEnv::load); in eval()
|
Completed in 5 milliseconds