Skip to content

Commit

Permalink
Impl Send for Timer on Windows
Browse files Browse the repository at this point in the history
Fixes #20943

Signed-off-by: Peter Atashian <retep998@gmail.com>
  • Loading branch information
retep998 committed Jan 19, 2015
1 parent bd8a43c commit abccfa4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/libstd/io/timer.rs
Expand Up @@ -227,6 +227,12 @@ mod test {
use thread::Thread;
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();
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/timer.rs
Expand Up @@ -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![];
Expand Down

0 comments on commit abccfa4

Please sign in to comment.