jni-rs v0.13.0 Release Notes
Release Date: 2019-07-05 // over 4 years ago-
0.13 brings major improvements in thread management, allowing to attach the native threads
permanently and safely;Executor
for extra convenience and safety; and other
๐ improvements and fixes.๐ โ ๏ธ If your code attaches native threads โ make sure to check the updated documentation
๐ of JavaVM to learn about the new features!โ Added
JavaVM::attach_current_thread_permanently
method, which attaches the current
thread and detaches it when the thread finishes. Daemon threads attached
withJavaVM::attach_current_thread_as_daemon
also automatically detach themselves
when finished. The number of currently attached threads may be acquired using
JavaVM::threads_attached
method. (#179, #180)Executor
โ a simple thread attachment manager which helps to safely
๐ execute a closure in attached thread context and to automatically free
created local references at closure exit. (#186)
๐ Changed
- 0๏ธโฃ The default JNI API version in
InitArgsBuilder
from V1 to V8. (#178) - Extended the lifetimes of
AutoLocal
to make it more flexible. (#190) - 0๏ธโฃ Default exception type from checked
java.lang.Exception
to uncheckedjava.lang.RuntimeException
.
๐ป It is used implicitly whenJNIEnv#throw
is invoked with exception message:
๐ปenv.throw("Exception message")
; however, for efficiency reasons, it is recommended
to specify the exception type explicitly and usethrow_new
:
๐env.throw_new(exception_type, "Exception message")
. (#194)
๐ Fixed