Package de.gmxhome.conrad.jpos.jpos_base
Class SyncObject
java.lang.Object
de.gmxhome.conrad.jpos.jpos_base.SyncObject
Class used for synchronisation purposes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
INFINITE
public static final long INFINITEConstant for infinite wait- See Also:
- Constant Field Values
-
-
Constructor Details
-
SyncObject
public SyncObject()Constructor, initializes Semaphore used for synchronization.
-
-
Method Details
-
suspend
public boolean suspend(long milliseconds)Suspends the current thread for a specified time or until signalled. Waits until timeout (in milliseconds, -1 = for ever) occurs or signalled by other thread- Parameters:
milliseconds
- Timeout (-1: without timeout).- Returns:
- true: SyncObject has been signalled, false otherwise.
-
signal
public void signal()Wake up other thread, if suspended. -
reset
public void reset()Reset object to an unsignalled state
-