The Windows DLL loader lock: how a Rust thread can hang your JVM
Summary
The QuestDB blog analyzes a Windows Loader Lock deadlock caused by TLS destructors during Rust/JNI thread teardown, which can freeze the JVM and stall garbage collection. It traces the root cause to JNI detach semantics, TLS, and Windows loader behavior, and details a practical fix: explicitly detach threads before TLS destructors run using Tokio's on_thread_stop callback.