mirror of
https://github.com/corda/corda.git
synced 2025-02-14 14:42:32 +00:00
handle locking for synchronized native methods
This commit is contained in:
parent
13fae991fd
commit
570925ad0e
@ -3949,6 +3949,14 @@ invokeNative2(MyThread* t, object method)
|
|||||||
&byteArrayBody(t, methodName(t, method), 0));
|
&byteArrayBody(t, methodName(t, method), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (methodFlags(t, method) & ACC_SYNCHRONIZED) {
|
||||||
|
if (methodFlags(t, method) & ACC_STATIC) {
|
||||||
|
acquire(t, methodClass(t, method));
|
||||||
|
} else {
|
||||||
|
acquire(t, *reinterpret_cast<object*>(args[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
{ ENTER(t, Thread::IdleState);
|
{ ENTER(t, Thread::IdleState);
|
||||||
|
|
||||||
result = t->m->system->call
|
result = t->m->system->call
|
||||||
@ -3960,6 +3968,14 @@ invokeNative2(MyThread* t, object method)
|
|||||||
returnType);
|
returnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (methodFlags(t, method) & ACC_SYNCHRONIZED) {
|
||||||
|
if (methodFlags(t, method) & ACC_STATIC) {
|
||||||
|
release(t, methodClass(t, method));
|
||||||
|
} else {
|
||||||
|
release(t, *reinterpret_cast<object*>(args[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (DebugNatives) {
|
if (DebugNatives) {
|
||||||
fprintf(stderr, "return from native method %s.%s\n",
|
fprintf(stderr, "return from native method %s.%s\n",
|
||||||
&byteArrayBody(t, className(t, methodClass(t, method)), 0),
|
&byteArrayBody(t, className(t, methodClass(t, method)), 0),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user