From 9e224c2bf18ebf8f871efb2e1aba43ed7970ebb7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 19 Dec 2014 11:29:39 -0800 Subject: std: Re-enable at_exit() The new semantics of this function are that the callbacks are run when the *main thread* exits, not when all threads have exited. This implies that other threads may still be running when the `at_exit` callbacks are invoked and users need to be prepared for this situation. Users in the standard library have been audited in accordance to these new rules as well. Closes #20012 --- src/libstd/sys/windows/timer.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/libstd/sys/windows/timer.rs') diff --git a/src/libstd/sys/windows/timer.rs b/src/libstd/sys/windows/timer.rs index 874838950cd..c0e67642a64 100644 --- a/src/libstd/sys/windows/timer.rs +++ b/src/libstd/sys/windows/timer.rs @@ -26,8 +26,6 @@ use libc; use ptr; use comm; -use sys::c; -use sys::fs::FileDesc; use sys_common::helper_thread::Helper; use prelude::*; use io::IoResult; @@ -80,9 +78,10 @@ fn helper(input: libc::HANDLE, messages: Receiver, _: ()) { None => {} } } + // See the comment in unix::timer for why we don't have any + // asserts here and why we're likely just leaving timers on + // the floor as we exit. Err(comm::Disconnected) => { - assert_eq!(objs.len(), 1); - assert_eq!(chans.len(), 0); break 'outer; } Err(..) => break -- cgit 1.4.1-3-g733a5