mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
handle volatile fields properly in JNI Get/Set methods
This commit ensures that we use the proper memory barriers or locking necessary to preserve volatile semantics for such fields when accessed or updated via JNI.
This commit is contained in:
parent
453ceb42ab
commit
7152c3fdb3
@ -15,7 +15,7 @@ public class VMField {
|
||||
public byte code;
|
||||
public short flags;
|
||||
public short offset;
|
||||
public short index;
|
||||
public int nativeID;
|
||||
public byte[] name;
|
||||
public byte[] spec;
|
||||
public FieldAddendum addendum;
|
||||
|
818
src/jnienv.cpp
818
src/jnienv.cpp
File diff suppressed because it is too large
Load Diff
@ -1075,7 +1075,7 @@ parseFieldTable(Thread* t, Stream& s, object class_, object pool)
|
||||
code,
|
||||
flags,
|
||||
0, // offset
|
||||
i,
|
||||
0, // native ID
|
||||
singletonObject(t, pool, name - 1),
|
||||
singletonObject(t, pool, spec - 1),
|
||||
addendum,
|
||||
@ -2388,6 +2388,7 @@ Thread::init()
|
||||
setRoot(this, Machine::ClassRuntimeDataTable, makeVector(this, 0, 0));
|
||||
setRoot(this, Machine::MethodRuntimeDataTable, makeVector(this, 0, 0));
|
||||
setRoot(this, Machine::JNIMethodTable, makeVector(this, 0, 0));
|
||||
setRoot(this, Machine::JNIFieldTable, makeVector(this, 0, 0));
|
||||
|
||||
m->localThread->set(this);
|
||||
|
||||
|
@ -1256,6 +1256,7 @@ class Machine {
|
||||
ClassRuntimeDataTable,
|
||||
MethodRuntimeDataTable,
|
||||
JNIMethodTable,
|
||||
JNIFieldTable,
|
||||
ShutdownHooks,
|
||||
FinalizerThread,
|
||||
ObjectsToFinalize,
|
||||
|
Loading…
Reference in New Issue
Block a user