implement JVM_HoldsLock

This commit is contained in:
Joel Dice 2012-03-11 05:06:08 -06:00
parent 04a34a75ed
commit 6cc0ddda7c

View File

@ -3289,8 +3289,21 @@ EXPORT(JVM_IsInterrupted)(Thread* t, jobject thread, jboolean clear)
return run(t, jvmIsInterrupted, arguments);
}
uint64_t
jvmHoldsLock(Thread* t, uintptr_t* arguments)
{
object m = objectMonitor(t, *reinterpret_cast<jobject>(arguments[0]), false);
return m and monitorOwner(t, m) == t;
}
extern "C" JNIEXPORT jboolean JNICALL
EXPORT(JVM_HoldsLock)(Thread*, jclass, jobject) { abort(); }
EXPORT(JVM_HoldsLock)(Thread* t, jclass, jobject o)
{
uintptr_t arguments[] = { reinterpret_cast<uintptr_t>(o) };
return run(t, jvmHoldsLock, arguments);
}
extern "C" JNIEXPORT void JNICALL
EXPORT(JVM_DumpAllStacks)(Thread*, jclass) { abort(); }