commit | facdabb3395cefebff43fefc553d4a03d080679d | [log] [tgz] |
---|---|---|
author | Philipp Vollmer <briefe@kebes.de> | Thu Apr 12 18:01:15 2018 +0200 |
committer | Philipp Vollmer <briefe@kebes.de> | Thu Apr 12 18:01:15 2018 +0200 |
tree | cbbd5210d7eb9db3c8850df01e1d4d5077975821 | |
parent | 968a3fefbf28c6b5bc934b89fcd666e6fde1ad11 [diff] |
Extract timer into variable so subscription doesn't get dropped.
diff --git a/src/timer.rs b/src/timer.rs index 62da286..7a4bfaa 100644 --- a/src/timer.rs +++ b/src/timer.rs
@@ -25,7 +25,8 @@ let expired = Cell::new(false); let mut with_callback = with_callback(|_, _| expired.set(true)); - with_callback.init().unwrap().set_alarm(duration).unwrap(); + let mut timer = with_callback.init().unwrap(); + timer.set_alarm(duration).unwrap(); syscalls::yieldk_for(|| expired.get()); }