/** * Decrement the number of readers. * Used to allow concurrent reads. */ public synchronized void releaseReadLock() throws ConcurrencyException { if (this.numberOfReaders == 0) { throw ConcurrencyException.signalAttemptedBeforeWait(); } else { this.numberOfReaders--; } if (this.numberOfReaders == 0) { notifyAll(); } }
/** * Decrement the number of readers. * Used to allow concurrent reads. */ public synchronized void releaseReadLock() throws ConcurrencyException { if (this.numberOfReaders == 0) { throw ConcurrencyException.signalAttemptedBeforeWait(); } else { this.numberOfReaders--; } if (this.numberOfReaders == 0) { notifyAll(); } }
/** * Decrement the number of readers. * Used to allow concurrent reads. */ public synchronized void releaseReadLock() throws ConcurrencyException { if (this.numberOfReaders == 0) { throw ConcurrencyException.signalAttemptedBeforeWait(); } else { this.numberOfReaders--; } if (this.numberOfReaders == 0) { notifyAll(); } }
/** * Decrement the depth for the active thread. * Assume the current thread is the active one. * Raise an error if the depth become < 0. * The notify will release the first thread waiting on the object, * if no threads are waiting it will do nothing. */ public synchronized void release() throws ConcurrencyException { if (this.depth == 0) { throw ConcurrencyException.signalAttemptedBeforeWait(); } else { this.depth--; } if (this.depth == 0) { this.activeThread = null; this.lockedByMergeManager = false; notifyAll(); } }
/** * Decrement the depth for the active thread. * Assume the current thread is the active one. * Raise an error if the depth become < 0. * The notify will release the first thread waiting on the object, * if no threads are waiting it will do nothing. */ public synchronized void release() throws ConcurrencyException { if (this.depth == 0) { throw ConcurrencyException.signalAttemptedBeforeWait(); } else { this.depth--; } if (this.depth == 0) { this.activeThread = null; if (shouldTrackStack){ this.stack = null; } this.lockedByMergeManager = false; notifyAll(); } }
/** * Decrement the depth for the active thread. * Assume the current thread is the active one. * Raise an error if the depth become < 0. * The notify will release the first thread waiting on the object, * if no threads are waiting it will do nothing. */ public synchronized void release() throws ConcurrencyException { if (this.depth == 0) { throw ConcurrencyException.signalAttemptedBeforeWait(); } else { this.depth--; } if (this.depth == 0) { this.activeThread = null; if (shouldTrackStack){ this.stack = null; } this.lockedByMergeManager = false; notifyAll(); } }