thread-control

Crates.iothread-control
lib.rsthread-control
version0.1.2
sourcesrc
created_at2016-09-21 13:05:18.508514
updated_at2017-04-27 09:35:18.399294
descriptionRust library to control threads' execution/status.
homepage
repositoryhttps://github.com/DenisKolodin/thread-control
max_upload_size
id6570
size17,110
Denis Kolodin (therustmonk)

documentation

README

Thread-control library

Missing Rust features to control threads execution.

Example:

use std::thread;
use thread_control::*;

fn main() {
    let (flag, control) = make_pair();
    let handle = thread::spawn(move || {
        while flag.alive() {
        }
    });
    assert_eq!(control.is_done(), false);
    control.stop(); // Also you can `control.interrupt()` it
    handle.join();
    assert_eq!(control.is_interrupted(), false);
    assert_eq!(control.is_done(), true);
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 9

cargo fmt