diff options
| -rw-r--r-- | src/libstd/io/timer.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/windows/timer.rs | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libstd/io/timer.rs b/src/libstd/io/timer.rs index 844a97dea2d..68ae7d0ff20 100644 --- a/src/libstd/io/timer.rs +++ b/src/libstd/io/timer.rs @@ -228,6 +228,12 @@ mod test { use time::Duration; #[test] + fn test_timer_send() { + let mut timer = Timer::new().unwrap(); + Thread::spawn(move || timer.sleep(Duration::milliseconds(1))); + } + + #[test] fn test_io_timer_sleep_simple() { let mut timer = Timer::new().unwrap(); timer.sleep(Duration::milliseconds(1)); diff --git a/src/libstd/sys/windows/timer.rs b/src/libstd/sys/windows/timer.rs index 1ae3979cd9a..12b4e56bf52 100644 --- a/src/libstd/sys/windows/timer.rs +++ b/src/libstd/sys/windows/timer.rs @@ -48,9 +48,9 @@ pub enum Req { RemoveTimer(libc::HANDLE, Sender<()>), } +unsafe impl Send for Timer {} unsafe impl Send for Req {} - fn helper(input: libc::HANDLE, messages: Receiver<Req>, _: ()) { let mut objs = vec![input]; let mut chans = vec![]; |
