Package it.polimi.ingsw.Utility
Class ProducerConsumerLock
java.lang.Object
it.polimi.ingsw.Utility.ProducerConsumerLock
- All Implemented Interfaces:
ReadWriteLock
Implements Producer Consumer paradigm
-
Field Summary
-
Constructor Summary
ConstructorDescriptionProducerConsumerLock
(boolean readInitiallyLocked, boolean writeInitiallyLocked) Implements Producer Consumer paradigm using a couple of ClassicLocks -
Method Summary
-
Field Details
-
readLock
-
writeLock
-
-
Constructor Details
-
ProducerConsumerLock
public ProducerConsumerLock(boolean readInitiallyLocked, boolean writeInitiallyLocked) Implements Producer Consumer paradigm using a couple of ClassicLocks- Parameters:
readInitiallyLocked
- read lock initially lockedwriteInitiallyLocked
- write lock initially locked
-
-
Method Details
-
readLock
- Specified by:
readLock
in interfaceReadWriteLock
-
writeLock
- Specified by:
writeLock
in interfaceReadWriteLock
-