wait_notify 0.1.0

a synchronization primitive for Rust that provides basic wait and notify functionality
Documentation
  • Coverage
  • 80%
    4 out of 5 items documented1 out of 4 items with examples
  • Size
  • Source code size: 38.71 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 283.83 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • nnsgmsone/wait_notify
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • nnsgmsone

wait_notify

wait_notify is a simple synchronization primitive for Rust that provides basic wait and notify functionality. It is similar to WaitGroup, but with only wait and notify functions.

Features

  • wait: Block the current thread until a notification is received.
  • notify: Wake up all waiting thread.

Getting Started

use wait_notify::WaitNotify;
use std::thread;

let wn = WaitNotify::default();
let wn_clone = wn.clone();
let handle = thread::spawn(move || {
    // do some work
    wn_clone.wait();
    // do some work
});
// do some work
wn.notify();
// do some work
handle.join().unwrap();

License

wait_notify source code is available under the GPL License.