wait_notify

Crates.iowait_notify
lib.rswait_notify
version0.1.0
sourcesrc
created_at2024-07-11 01:43:24.712549
updated_at2024-07-11 01:43:24.712549
descriptiona synchronization primitive for Rust that provides basic wait and notify functionality
homepagehttps://github.com/nnsgmsone
repositoryhttps://github.com/nnsgmsone/wait_notify
max_upload_size
id1298976
size39,026
(nnsgmsone)

documentation

https://docs.rs/wait_notify

README

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.

Commit count: 2

cargo fmt