~akiban-technologies/akiban-persistit/3.1.1

« back to all changes in this revision

Viewing changes to core/src/main/java/com/persistit/SharedResource.java

  • Committer: Padraig O'Sullivan
  • Date: 2011-02-11 20:28:04 UTC
  • mfrom: (116.3.7 nextgen)
  • Revision ID: osullivan.padraig@gmail.com-20110211202804-kes6rx45g23ztxo4
Merge Peter.

Show diffs side-by-side

added added

removed removed

Lines of Context:
320
320
    void release() {
321
321
        synchronized (_lock) {
322
322
            if ((_status & CLAIMED_MASK) == 0) {
323
 
                if (Debug.ENABLED)
 
323
                if (Debug.ENABLED) {
324
324
                    Debug.debug2(true);
 
325
                }
325
326
                throw new IllegalStateException(
326
327
                        "Release on unclaimed resource " + this);
327
328
            }
341
342
            // Dequeue and wake up each WaitingThread that could now execute
342
343
            //
343
344
            if (free) {
344
 
                if (Debug.ENABLED)
 
345
                if (Debug.ENABLED) {
345
346
                    Debug.$assert(_writerThread == null);
346
 
                if (Debug.ENABLED)
347
347
                    Debug.$assert(checkWaitQueue());
 
348
                }
348
349
 
349
350
                while ((_status & WRITER_MASK) == 0) {
350
351
                    WaitingThread wt = dequeue((_status & CLAIMED_MASK) == 0);
366
367
                    }
367
368
                    wt.wake();
368
369
                }
369
 
                if (Debug.ENABLED)
 
370
                if (Debug.ENABLED) {
370
371
                    Debug.$assert(checkWaitQueue());
 
372
                }
371
373
            }
372
374
        }
373
375
    }