rollup merge of #21389: retep998/timer
Fixes #20943 and adds a test for it r? @alexcrichton
This commit is contained in:
commit
8b10733e7a
|
@ -227,6 +227,12 @@ mod test {
|
||||||
use thread::Thread;
|
use thread::Thread;
|
||||||
use time::Duration;
|
use time::Duration;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_timer_send() {
|
||||||
|
let mut timer = Timer::new().unwrap();
|
||||||
|
Thread::spawn(move || timer.sleep(Duration::milliseconds(1)));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_io_timer_sleep_simple() {
|
fn test_io_timer_sleep_simple() {
|
||||||
let mut timer = Timer::new().unwrap();
|
let mut timer = Timer::new().unwrap();
|
||||||
|
|
|
@ -48,9 +48,9 @@ pub enum Req {
|
||||||
RemoveTimer(libc::HANDLE, Sender<()>),
|
RemoveTimer(libc::HANDLE, Sender<()>),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsafe impl Send for Timer {}
|
||||||
unsafe impl Send for Req {}
|
unsafe impl Send for Req {}
|
||||||
|
|
||||||
|
|
||||||
fn helper(input: libc::HANDLE, messages: Receiver<Req>, _: ()) {
|
fn helper(input: libc::HANDLE, messages: Receiver<Req>, _: ()) {
|
||||||
let mut objs = vec![input];
|
let mut objs = vec![input];
|
||||||
let mut chans = vec![];
|
let mut chans = vec![];
|
||||||
|
|
Loading…
Reference in New Issue