MCPcopy Create free account
hub / github.com/astonbitecode/j4rs / detach_thread_on_drop

Method detach_thread_on_drop

rust/src/api/mod.rs:126–128  ·  view source on GitHub ↗

If false, the thread will not be detached when the Jvm is being dropped. This is useful when creating a Jvm while on a Thread that is created in the Java world. When this Jvm is dropped, we don't want to detach the thread from the Java VM. It prevents errors like: `attempting to detach while still running code`

(&mut self, detach: bool)

Source from the content-addressed store, hash-verified

124 ///
125 /// It prevents errors like: `attempting to detach while still running code`
126 pub fn detach_thread_on_drop(&mut self, detach: bool) {
127 self.detach_thread_on_drop = detach;
128 }
129
130 /// Creates a new Jvm.
131 /// If a JavaVM is already created by the current process, it attempts to attach the current thread to it.

Calls

no outgoing calls

Tested by

no test coverage detected