Class ReadWriteLockSupport
java.lang.Object
net.emustudio.emulib.ReadWriteLockSupport
Runs actions under a
ReentrantReadWriteLock.
Actions can throw checked exceptions; they are rethrown unchanged (see Unchecked).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TCalls the action under the read lock.voidRuns the action under the read lock.<T> TCalls the action under the write lock.voidRuns the action under the write lock.
-
Constructor Details
-
ReadWriteLockSupport
public ReadWriteLockSupport()
-
-
Method Details
-
lockWrite
Runs the action under the write lock.- Parameters:
r- the action
-
lockWrite
Calls the action under the write lock.- Type Parameters:
T- the result type- Parameters:
c- the action- Returns:
- the action result
-
lockRead
Runs the action under the read lock.- Parameters:
r- the action
-
lockRead
Calls the action under the read lock.- Type Parameters:
T- the result type- Parameters:
c- the action- Returns:
- the action result
-