TrueZIP 6.8.2

de.schlichtherle.io
Interface ReentrantLock

All Known Implementing Classes:
ReentrantReadWriteLock.AbstractLock, ReentrantReadWriteLock.ReadLock, ReentrantReadWriteLock.WriteLock

interface ReentrantLock

Similar to java.util.concurrent.locks.Lock, but simplified and adapted to the particular needs of TrueZIP. The subset of methods common to both this interface and its cousin in JSE 1.5 is identical in functionality. However, some other methods have been added here in order to suit the particular needs of TrueZIP (see ArchiveController).

Since:
TrueZIP 6.2
Version:
$Id: ReentrantLock.java 06f3ba684701 2010/11/04 01:15:55 christian $
Author:
Christian Schlichtherle

Method Summary
 boolean isLocked()
          Returns true if and only if the current thread has acquired this lock.
 void lock()
          Acquires this lock by the current thread, eventually blocking.
 int lockCount()
          Returns the number of times the current thread has successfully acquired this lock.
 void lockInterruptibly()
          Acquires this lock by the current thread unless it is interrupted, eventually blocking.
 boolean tryLock()
          Acquires this lock if and only if it is available at the time of invocation by the current thread and returns true.
 void unlock()
          Releases this lock.
 

Method Detail

isLocked

boolean isLocked()
Returns true if and only if the current thread has acquired this lock.


lockCount

int lockCount()
Returns the number of times the current thread has successfully acquired this lock.


lock

void lock()
Acquires this lock by the current thread, eventually blocking.


lockInterruptibly

void lockInterruptibly()
                       throws InterruptedException
Acquires this lock by the current thread unless it is interrupted, eventually blocking.

Throws:
InterruptedException

tryLock

boolean tryLock()
Acquires this lock if and only if it is available at the time of invocation by the current thread and returns true. Otherwise, If this lock is not available then false is returned.


unlock

void unlock()
            throws IllegalMonitorStateException
Releases this lock.

Throws:
IllegalMonitorStateException - If the current thread has not acquired this lock.

TrueZIP 6.8.2

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.