summaryrefslogtreecommitdiffstats
path: root/tokio/src/time/tests
diff options
context:
space:
mode:
authorÉmile Grégoire <eg@emilegregoire.ca>2020-07-28 23:43:19 -0400
committerGitHub <noreply@github.com>2020-07-28 20:43:19 -0700
commit646fbae76535e397ef79dbcaacb945d4c829f666 (patch)
tree49c00b3825463cae83eef0e1b65ee3d8266980c3 /tokio/src/time/tests
parent1562bb314482215eb7517e6b8b8bdecbacf10e79 (diff)
rt: fix potential leak during runtime shutdown (#2649)
JoinHandle of threads created by the pool are now tracked and properly joined at shutdown. If the thread does not return within the timeout, then it's not joined and left to the OS for cleanup. Also, break a cycle between wakers held by the timer and the runtime. Fixes #2641, #2535
Diffstat (limited to 'tokio/src/time/tests')
-rw-r--r--tokio/src/time/tests/test_delay.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tokio/src/time/tests/test_delay.rs b/tokio/src/time/tests/test_delay.rs
index b708f6fc..b732e458 100644
--- a/tokio/src/time/tests/test_delay.rs
+++ b/tokio/src/time/tests/test_delay.rs
@@ -351,6 +351,8 @@ fn unpark_is_delayed() {
self.0.advance(ms(436));
Ok(())
}
+
+ fn shutdown(&mut self) {}
}
impl Unpark for MockUnpark {
@@ -434,6 +436,8 @@ impl Park for MockPark {
self.0.advance(duration);
Ok(())
}
+
+ fn shutdown(&mut self) {}
}
impl Unpark for MockUnpark {