WZZIC3CRIGXJWGFRLM2JM7IN6IIZQZ4U4TPMWPNYYSJFNJM25LWQC
move || loop {
let state = mutex.lock().unwrap().get();
match state {
State::Empty => thread::park(),
State::Wait(duration) => thread::sleep(duration),
State::Ready(data) => f(data),
let stopped = stopped.clone();
move || {
while !stopped.load(Ordering::Relaxed) {
let state = mutex.lock().unwrap().get();
match state {
State::Empty => thread::park(),
State::Wait(duration) => thread::sleep(duration),
State::Ready(data) => f(data),
}