MCPcopy Create free account
hub / github.com/NthTensor/Forte / increment

Function increment

src/thread_pool.rs:2587–2600  ·  view source on GitHub ↗
(worker: &Worker, slice: &mut [u32])

Source from the content-addressed store, hash-verified

2585 /// # static THREAD_POOL: ThreadPool = ThreadPool::new();
2586 /// # THREAD_POOL.populate();
2587 /// # THREAD_POOL.with_worker(|worker| {
2588 /// let ok: Vec<i32> = vec![1, 2, 3];
2589 /// forte::scope(|scope| {
2590 /// let bad: Vec<i32> = vec![4, 5, 6];
2591 /// scope.spawn(|_: &Worker| {
2592 /// // Transfer ownership of `bad` into a local variable (also named `bad`).
2593 /// // This will force the closure to take ownership of `bad` from the environment.
2594 /// let bad = bad;
2595 /// println!("ok: {:?}", ok); // `ok` is only borrowed.
2596 /// println!("bad: {:?}", bad); // refers to our local variable, above.
2597 /// });
2598 ///
2599 /// scope.spawn(|_: &Worker| println!("ok: {:?}", ok)); // we too can borrow `ok`
2600 /// });
2601 /// # });
2602 /// ```
2603 ///

Callers 2

join_deepFunction · 0.70
join_wideFunction · 0.70

Calls 1

joinMethod · 0.80

Tested by 2

join_deepFunction · 0.56
join_wideFunction · 0.56