Interface Lock
-
- All Known Implementing Classes:
J2SE14ReadWriteLock.ReadLock,J2SE14ReadWriteLock.WriteLock
public interface LockA lock is a tool for controlling access to a shared resource by multiple threads.This interface is a back-port of the
Lockclass that first appeared in J2SE 1.5. Due to a requirement for sophisticated concurrency, this interface has been back-ported for use in J2SE 1.4 (and greater). It shares similar method signatures to be consistent with the J2SE 1.5 API.- Author:
- Jesse Wilson
- See Also:
Lock, Lock
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidlock()Acquires the lock.booleantryLock()Acquires the lock only if it is free at the time of invocation.voidunlock()Releases the lock.
-