Skip to content

nnsgmsone/wait_notify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages