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

Method attach_thread_with_no_detach_on_drop

rust/src/api/mod.rs:115–119  ·  view source on GitHub ↗

Attaches the current thread to an active JavaVM and instructs that the Jvm will detach the Java JVM from the thread when the rust Jvm is 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.

()

Source from the content-addressed store, hash-verified

113 /// This is useful when creating a Jvm while on a Thread that is created in the Java world.
114 /// When this Jvm is dropped, we don't want to detach the thread from the Java VM.
115 pub fn attach_thread_with_no_detach_on_drop() -> errors::Result<Jvm> {
116 let mut jvm = Jvm::attach_thread()?;
117 jvm.detach_thread_on_drop(false);
118 Ok(jvm)
119 }
120
121 /// If false, the thread will not be detached when the Jvm is being dropped.
122 /// This is useful when creating a Jvm while on a Thread that is created in the Java world.

Callers

nothing calls this directly

Calls 1

detach_thread_on_dropMethod · 0.80

Tested by

no test coverage detected