@GridToStringExclude public class GridBusyLock extends Object
For example, there may be a manager that have different threads for some
purposes and the manager must not be stopped while at least a single thread
is in "busy" state. In this situation each thread must enter to "busy"
state calling method enterBusy() in critical pieces of code
which, i.e. use grid kernal functionality, notifying that the manager
and the whole grid kernal cannot be stopped while it's in progress. Once
the activity is done, the thread should leave "busy" state calling method
leaveBusy(). The manager itself, when stopping, should call method
block() that blocks till all activities leave "busy" state.
| Constructor and Description |
|---|
GridBusyLock() |
| Modifier and Type | Method and Description |
|---|---|
void |
block()
Blocks current thread till all activities left "busy" state
and prevents them from further entering to "busy" state.
|
boolean |
blockedByCurrentThread()
Checks if busy lock was blocked by current thread.
|
boolean |
enterBusy()
Enters "busy" state.
|
void |
leaveBusy()
Leaves "busy" state.
|
void |
unblock()
Makes possible for activities entering busy state again.
|
public boolean enterBusy()
true if entered to busy state.public boolean blockedByCurrentThread()
True if busy lock was blocked by current thread.public void leaveBusy()
public void block()
public void unblock()
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.10.0 Release Date : March 10 2021