jniLazy

inline fun <T> jniLazy(noinline initializer: context(JniEnv, MemScope) () -> T): JniLazy<T>(source)

Creates a new instance of the JniLazy that uses the specified initialization function initializer.

Uses a lock to ensure that only a single thread can initialize the value, and ensures that initialized value is visible by all threads.

If the initialization of a value throws an exception, it will attempt to reinitialize the value at next access.