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
This commit is contained in:
Émile Grégoire
2020-07-28 20:43:19 -07:00
committed by GitHub
parent 1562bb3144
commit 646fbae765
16 changed files with 139 additions and 24 deletions
+2 -2
View File
@@ -67,7 +67,7 @@ process = [
"winapi/winerror",
]
# Includes basic task execution capabilities
rt-core = []
rt-core = ["slab"]
rt-util = []
rt-threaded = [
"num_cpus",
@@ -129,7 +129,7 @@ proptest = "0.9.4"
tempfile = "3.1.0"
[target.'cfg(loom)'.dev-dependencies]
loom = { version = "0.3.4", features = ["futures", "checkpoint"] }
loom = { version = "0.3.5", features = ["futures", "checkpoint"] }
[package.metadata.docs.rs]
all-features = true