Waithandle
A Rust library that makes signaling between threads a bit more ergonomic.
Uses Condvar and Mutex under the hood to block threads without consuming CPU time.
Usage
use Arc;
use Duration;
// Create the signaler and the listener
let = new;
// Signal a thread
signaler.signal?;
// Did someone signal us?
if listener.check?
// Wait for 5 seconds or until someone signals us
if listener.wait?
Running the example
> cargo run --example simple
Doing some work...
Doing some work...
Doing some work...
Doing some work...
Doing some work...
Signaling thread...
Joining thread...
Someone told us to exit!
Done!