rust_book_code 0.2.1

The code of rust book
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::sync::{Arc, Mutex};

mod message_passing;
mod shared_state;
mod threads;

pub fn concurrency() {
    threads::create();
    threads::move_closure();

    message_passing::channel();
    message_passing::channel_waiting();
    message_passing::clone_channel();

    shared_state::mutex();
    shared_state::shared_mutex();
    // todo: write a deadlocks by Mutex<T>/Arc<T>
}