How know we have an object's lock in JNI?

I have an object on which I want to call env->MonitorEnter, but only if we don't already have the lock. If it is locked, I want to find out if we have the lock and if so i want to call env->MonitorExit. How would I do this?
[237 byte] By [6tr6tra] at [2007-10-3 10:08:53]
# 1
If you can't do it in java then it is really unlikely that you can do it JNI unless you want to spend a lot of time in the VM source code (or perhaps with debugging assembly) figuring out a very version specific piece of code to do that.
jschella at 2007-7-15 5:28:38 > top of Java-index,Java HotSpot Virtual Machine,Specifications...