monitorExit

context(env: JniEnv)
fun monitorExit(obj: JObject)(source)

The current thread must be the owner of the monitor associated with the underlying Java object referred to by obj. The thread decrements the counter indicating the number of times it has entered this monitor. If the value of the counter becomes zero, the current thread releases the monitor.

Native code must not use monitorExit to exit a monitor entered through a synchronized method or a monitorenter Java virtual machine instruction.