Skip to content

Instantly share code, notes, and snippets.

@pimeys
Created September 27, 2017 14:01
Show Gist options
  • Save pimeys/e87aa4781a1e8b152ab8eb01fe5ab6fd to your computer and use it in GitHub Desktop.
Save pimeys/e87aa4781a1e8b152ab8eb01fe5ab6fd to your computer and use it in GitHub Desktop.
struct T {
handle: JoinHandle<()>,
}
impl Drop for T {
fn drop(&mut self) {
self.handle.thread().unpark();
self.handle.join().unwrap();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment