public interface LockProtectedRunnable
A
LockProtectedRunnable represents a task which is to be
executed within the context of a Lock on a
[@link de.grogra.util.Lockable} resource. The execution of the task is
induced by one of the execute methods in
Lockable.- Author:
- Ole Kniemeyer
-
Method Summary
-
Method Details
-
run
The invocation of this method is induced by one of theexecutemethods inLockable. The thread which invokes this method possesses alockas requested by the invocation ofexecute. Ifsyncistrue, the invocation is synchronous, meaning that it happens directly within the invocation of theexecutemethod. Otherwise, the invocation is asynchronous, meaning that it happens later in a thread which may differ from the original thread.Normally, the lock is released after execution of
runhas finished. However, when the methodLock.retain()has been invoked withinrun, the lock is retained and remains active in order to be passed to one of theexecutemethods ofLockable.- Parameters:
sync- synchronous invocation?lock- the lock which is currently acquired
-