Package it.polimi.ingsw.Utility
Class ClassicLock
java.lang.Object
it.polimi.ingsw.Utility.ClassicLock
- All Implemented Interfaces:
Lock
Classic Lock implementation
-
Field Summary
-
Constructor Summary
ConstructorDescriptionClassicLock
(boolean initiallyLocked) Classic Lock implementation, using a non re-entrant strategy -
Method Summary
-
Field Details
-
mutex
-
-
Constructor Details
-
ClassicLock
public ClassicLock(boolean initiallyLocked) Classic Lock implementation, using a non re-entrant strategy- Parameters:
initiallyLocked
- true if the lock has to be initially locked
-
-
Method Details
-
lock
public void lock() -
lockInterruptibly
- Specified by:
lockInterruptibly
in interfaceLock
- Throws:
InterruptedException
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLock
in interfaceLock
- Throws:
InterruptedException
-
unlock
public void unlock() -
newCondition
- Specified by:
newCondition
in interfaceLock
-