diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-01-01 10:19:42 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-20 10:56:27 -0700 |
| commit | 1cc9718fdef63476ffdf3f0bcd74b554b083f378 (patch) | |
| tree | 9ab128b25b8bd688a26897a5b8029672d737140e /src/libstd/sys/unix | |
| parent | 46f649c479ce40f3b4590590dda6c2895e8d60f6 (diff) | |
| download | rust-1cc9718fdef63476ffdf3f0bcd74b554b083f378.tar.gz rust-1cc9718fdef63476ffdf3f0bcd74b554b083f378.zip | |
Revert "Revert "std: Re-enable at_exit()""
This reverts commit aec67c2ee0f673ea7b0e21c2fe7e0f26a523d823.
Diffstat (limited to 'src/libstd/sys/unix')
| -rw-r--r-- | src/libstd/sys/unix/timer.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libstd/sys/unix/timer.rs b/src/libstd/sys/unix/timer.rs index ef0274fdda9..ef175d68fc4 100644 --- a/src/libstd/sys/unix/timer.rs +++ b/src/libstd/sys/unix/timer.rs @@ -170,8 +170,15 @@ fn helper(input: libc::c_int, messages: Receiver<Req>, _: ()) { 1 => { loop { match messages.try_recv() { + // Once we've been disconnected it means the main thread + // is exiting (at_exit has run). We could still have + // active timers for other threads, so we're just going + // to drop them all on the floor. This is all we can + // really do, however, to prevent resource leakage. The + // remaining timers will likely start panicking quickly + // as they attempt to re-use this thread but are + // disallowed to do so. Err(TryRecvError::Disconnected) => { - assert!(active.len() == 0); break 'outer; } |
