Constructor and Description |
---|
With(Lock lock)
Deprecated.
Kept only to avoid breaking existing code.
|
With(Lock lock,
long lockWaitTimeout)
Constructs an executor that will grab the named lock.
|
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
doBody()
Code to execute with exclusive access.
|
Object |
run()
Calls
doBody() while lock is obtained. |
@Deprecated public With(Lock lock)
public With(Lock lock, long lockWaitTimeout)
protected abstract Object doBody() throws IOException
IOException
public Object run() throws IOException
doBody()
while lock is obtained. Blocks if lock
cannot be obtained immediately. Retries to obtain lock once per second
until it is obtained, or until it has tried ten times. Lock is released when
doBody()
exits.IOException
Copyright © 2024 GATE. All rights reserved.