From d45e985669d1bc532862ed3a50dce9cfdf08d7ff Mon Sep 17 00:00:00 2001 From: Vytautas Astrauskas Date: Mon, 20 Apr 2020 16:57:30 -0700 Subject: [PATCH] Clarify FIXME. --- src/thread.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/thread.rs b/src/thread.rs index 80c9965aa1d8..aee9b8a6f56d 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -357,7 +357,12 @@ impl<'mir, 'tcx: 'mir> ThreadManager<'mir, 'tcx> { if self.threads[MAIN_THREAD].state == ThreadState::Terminated { // The main thread terminated; stop the program. if self.threads.iter().any(|thread| thread.state != ThreadState::Terminated) { - // FIXME: This check should be either configurable or just emit a warning. + // FIXME: This check should be either configurable or just emit + // a warning. For example, it seems normal for a program to + // terminate without waiting for its detached threads to + // terminate. However, this case is not trivial to support + // because we also probably do not want to consider the memory + // owned by these threads as leaked. throw_unsup_format!("the main thread terminated without waiting for other threads"); } return Ok(SchedulingAction::Stop);