MCPcopy Index your code
hub / github.com/SSheldon/rust-dispatch / async_increment

Function async_increment

src/queue.rs:345–351  ·  view source on GitHub ↗
(queue: &Queue, num: &Arc<Mutex<i32>>)

Source from the content-addressed store, hash-verified

343 use super::*;
344
345 fn async_increment(queue: &Queue, num: &Arc<Mutex<i32>>) {
346 let num = num.clone();
347 queue.exec_async(move || {
348 let mut num = num.lock().unwrap();
349 *num += 1;
350 });
351 }
352
353 #[test]
354 fn test_serial_queue() {

Callers 4

test_serial_queue_asyncFunction · 0.70
test_barrier_syncFunction · 0.70
test_barrier_asyncFunction · 0.70
test_suspendFunction · 0.70

Calls 2

cloneMethod · 0.45
exec_asyncMethod · 0.45

Tested by 4

test_serial_queue_asyncFunction · 0.56
test_barrier_syncFunction · 0.56
test_barrier_asyncFunction · 0.56
test_suspendFunction · 0.56