tisonkun commented on code in PR #7000:
URL: https://github.com/apache/opendal/pull/7000#discussion_r2614887541


##########
bindings/java/src/executor.rs:
##########
@@ -135,6 +136,18 @@ pub(crate) fn make_tokio_executor(env: &mut JNIEnv, cores: 
usize) -> Result<Exec
                 *cell.borrow_mut() = Some(env.get_raw());
             })
         })
+        .on_thread_stop(move || {
+            ENV.with(|cell| {
+                *cell.borrow_mut() = None;
+            });
+
+            // `jni` will normally detach daemon threads via a TLS destructor, 
which can lead to
+            // deadlocks on Windows during DLL unload. Detach explicitly while 
the thread is
+            // still running to clear the TLS guard.

Review Comment:
   This analysis is not quite accurate. I'd suggest lin to 
https://github.com/apache/opendal/issues/6869 here since it provides concrete 
and adequate information.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to