public class SingleRemoveSynchronizedAddLock extends Object
Constructor and Description |
---|
SingleRemoveSynchronizedAddLock() |
SingleRemoveSynchronizedAddLock(boolean dataAvailable) |
Modifier and Type | Method and Description |
---|---|
void |
abortRemove()
Abort any polling remover thread
|
long |
getAddWaitTimeout() |
long |
getRemoveWaitTimeout() |
boolean |
isAddLocked()
Check if an add thread owns the lock.
|
boolean |
isDataAvailable()
Check if the locked object has data available
i.e. the remover can stop poling and get the lock.
|
boolean |
isRemoveLocked()
Check if the remove thread owns the lock.
|
boolean |
isRemovePolling()
Check if the remove thread is polling.
|
void |
lockAdd()
Acquires the lock by an add thread and sets the add flag.
|
boolean |
lockRemove()
Acquires the lock by the remove thread and sets the remove flag.
|
void |
setAddWaitTimeout(long timeout)
Set value of addWaitTimeout
|
void |
setRemoveWaitTimeout(long timeout)
Set value of removeWaitTimeout
|
void |
unlockAdd(boolean dataAvailable)
Releases the lock by an add thread and reset the remove flag.
|
void |
unlockRemove()
Releases the lock by the remove thread and reset the add flag.
|
public SingleRemoveSynchronizedAddLock()
public SingleRemoveSynchronizedAddLock(boolean dataAvailable)
public long getAddWaitTimeout()
public void setAddWaitTimeout(long timeout)
public long getRemoveWaitTimeout()
public void setRemoveWaitTimeout(long timeout)
public boolean isDataAvailable()
public boolean isAddLocked()
public boolean isRemoveLocked()
public boolean isRemovePolling()
public void lockAdd()
public boolean lockRemove()
public void unlockAdd(boolean dataAvailable)
public void unlockRemove()
public void abortRemove()
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.