mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 09:13:07 +03:00
Impl Send for Timer on Windows
Fixes #20943 Signed-off-by: Peter Atashian <retep998@gmail.com>
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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![];
|
||||
|
||||
Reference in New Issue
Block a user