servoshell: Hide information about outstanding threads by default. (#39044)

This output doesn't matter to most developers and testers, and it breaks
`./mach test-speedometer`. Let's hide it by default and add a flag to
opt in.

Testing: No testing for debug output.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-08-30 16:40:29 -04:00 committed by GitHub
parent 0481477f35
commit 6ab1b5e9dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,23 +15,23 @@ pub fn deinit(clean_shutdown: bool) {
let thread_count = unsafe { macos_count_running_threads() }; let thread_count = unsafe { macos_count_running_threads() };
if thread_count != 1 { if thread_count != 1 {
println!( log::debug!(
"{} threads are still running after shutdown (bad).", "{} threads are still running after shutdown (bad).",
thread_count thread_count
); );
if clean_shutdown { if clean_shutdown {
println!("Waiting until all threads have shutdown"); log::debug!("Waiting until all threads have shutdown");
loop { loop {
let thread_count = unsafe { macos_count_running_threads() }; let thread_count = unsafe { macos_count_running_threads() };
if thread_count == 1 { if thread_count == 1 {
break; break;
} }
thread::sleep(Duration::from_millis(1000)); thread::sleep(Duration::from_millis(1000));
println!("{} threads are still running.", thread_count); log::debug!("{} threads are still running.", thread_count);
} }
} }
} else { } else {
println!("All threads have shutdown (good)."); log::debug!("All threads have shutdown (good).");
} }
} }