You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rt_multi_threaded.rs
    path of file: ./repos/tokio/benches
    
    the code of the file until where you have to start completion: //! Benchmark implementation details of the thread
    
fn rt_multi_spawn_many_local(c: &mut Criterion) {
    let rt = rt();

    let (tx, rx) = mpsc::sync_channel(1000);
    let rem = Arc::new(AtomicUsize::new(0));

    c.bench_function("spawn_many_local", |b| {
        b.iter(|| {
            rem.store(NUM_SPAWN, Relaxed);

            rt.block_on(async {
                for _ in 0..NUM_SPAWN {
                    let tx = tx.clone();
                    let rem = rem.clone();

                    tokio::spawn(async move {
                        if 1 == rem.fetch_sub(1, Relaxed) {
                            tx.send(()).unwrap();
                        }
                    });
                }

                rx.recv().unwrap();
            });
        })
    });
}