~pbeaman/akiban-persistit/fix-hard-commit-infinite-loop

« back to all changes in this revision

Viewing changes to src/main/java/com/persistit/BufferPool.java

merge pbeaman: Fixes bug 1032701 - Interrupt causes Thread to exit without releasing claims.

https://code.launchpad.net/~pbeaman/akiban-persistit/fix-1032701-interrupts-leave-latches/+merge/118253

Show diffs side-by-side

added added

removed removed

Lines of Context:
613
613
        return result;
614
614
    }
615
615
 
616
 
    private void invalidate(Buffer buffer) throws PersistitInterruptedException {
 
616
    private void invalidate(Buffer buffer) {
617
617
        Debug.$assert0.t(buffer.isValid() && buffer.isMine());
618
618
 
619
619
        while (!detach(buffer)) {
620
 
            Util.spinSleep();
 
620
            //
 
621
            // Spin until detach succeeds. Note: this method must not throw an Exception
 
622
            // because it is called in at at critical time when cleanup must be done.
 
623
            // It is not possible to lock the hash bucket here due to possible deadlock.
 
624
            // However, the likelihood of a lengthy live-lock is infinitesimal so polling
 
625
            // is acceptable.
 
626
            //
 
627
                try {
 
628
                        Thread.sleep(1);
 
629
                } catch (InterruptedException ie) {
 
630
                        // ignore
 
631
                }
621
632
        }
622
633
        buffer.clearValid();
623
634
        buffer.clearDirty();