Click or drag to resize

IJavaObjectBaseMonitorEnter Method

Enters the monitor associated with the underlying with this IJavaObjectBase

Namespace: MASES.JCOBridge.C2JBridge.JVMInterop
Assembly: C2JBridge (in C2JBridge.dll) Version: 2.5.17.240622-f0da58d62b7e98f73f32432917df8eb1a5f062a3
Syntax
void MonitorEnter()
Remarks
Each Java object has a monitor associated with it. If the current thread already owns the monitor associated with IJavaObjectBase, the JVM increments a counter in the monitor indicating the number of times this thread has entered the monitor. If the monitor associated with IJavaObjectBase is not owned by any thread, the current thread becomes the owner of the monitor, setting the entry count of this monitor to 1. If another thread already owns the monitor associated with obj, the current thread waits until the monitor is released, then tries again to gain ownership. A monitor entered through a MonitorEnter function call cannot be exited using the monitorexit Java virtual machine instruction or a synchronized method return. A MonitorEnter function call and a monitorenter Java virtual machine instruction may race to enter the monitor associated with the same object. To avoid deadlocks, a monitor entered through a MonitorEnter function call must be exited using the MonitorExit call, unless the DetachCurrentThread call is used to implicitly release JNI monitors.
See Also