private boolean onReadAccess(Object obj, long field, Type type) {
if (vr) {
// Visible read
if (readLock == LockTable.LOCKED_WRITE) {
// We already own that lock in write mode
WriteFieldAccess w = writeSet.get(readHash, obj, field);
if (w == null)
return false;
readValue = w.getValue();
return true;
} else {
// We already own that lock in read mode
return false;
}
} else {
// Invisible read
if ((status.get() & STATUS_MASK) != TX_ACTIVE) {
// We have been killed: abort
throw KILLED_EXCEPTION;
}
if (readLock == LockTable.LOCKED_WRITE) {
// We already own that lock in write mode
WriteFieldAccess w = writeSet.get(readHash, obj, field);
if (w == null)
return false;
readValue = w.getValue();
return true;
} else if (readLock == LockTable.LOCKED_READ) {
// We already own that lock in read mode
return false;
}