SHARE
TWEET

Untitled

a guest Mar 26th, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::sync::RwLock;
  2. fn main() {
  3.     let lock = RwLock::new(1);
  4.     if let Ok(n) = lock.read() {
  5.         *lock.write().unwrap() = *n+1;
  6.     }
  7.     return ();
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top