Merge pull request #1176 from yesanyou/main

update thread.md about reference
pull/1196/head
Sunface 2 years ago committed by GitHub
commit ac8ad1cf7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -447,14 +447,14 @@ fn main() {
let pair2 = pair.clone();
thread::spawn(move|| {
let &(ref lock, ref cvar) = &*pair2;
let (lock, cvar) = &*pair2;
let mut started = lock.lock().unwrap();
println!("changing started");
*started = true;
cvar.notify_one();
});
let &(ref lock, ref cvar) = &*pair;
let (lock, cvar) = &*pair;
let mut started = lock.lock().unwrap();
while !*started {
started = cvar.wait(started).unwrap();

Loading…
Cancel
Save