@Override public <A> void delete(long recid, Serializer<A> serializer) { commitLock.readLock().lock(); try { uncommitedData = true; Lock lock = locks[Store.lockPos(recid)].writeLock(); lock.lock(); try { Object old = get(recid, serializer); for (Reference<Tx> txr : txs) { Tx tx = txr.get(); if (tx == null) continue; tx.old.putIfAbsent(recid, old); } super.delete(recid, serializer); } finally { lock.unlock(); } } finally { commitLock.readLock().unlock(); } }
protected <A> void superDelete(long recid, Serializer<A> serializer) { assert (commitLock.isWriteLockedByCurrentThread()); super.delete(recid, serializer); }