neo4j/community — pull request #791 by tinwelint (2012-08-20 10:05:29+00:00)
Title: Fix for BufferOver/UnderFlowExceptions concurrency issue in PersistenceWindowPool

o Proper closing of windows, not just closing for the sake of preventing marking as in use in all places.
o Proper handover of PersistenceRows to other threads if marked deciding whether to close or not
o Simplified state keeping of whether or not a window is locked
o Reimplemented releasing a PersistenceRow to force unlock being the last operation
o PersistenceRows are marked as in use in the constructor to avoid an issue where a row could be shared too early

These fixes BufferOver/UnderFlowExceptions arising from closed or contemporary closing PersistenceRow instances that leaked out by mistake.