|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jppf.utils.ThreadSynchronization
public abstract class ThreadSynchronization
This class implements a goToSleep and a wakeUp method as wrappers to Object.wait() and
Object.notifyAll() wrappers.
| Field Summary | |
|---|---|
protected boolean |
stopped
Determines whether the thread's run() method should terminate. |
| Constructor Summary | |
|---|---|
ThreadSynchronization()
|
|
| Method Summary | |
|---|---|
void |
goToSleep()
Cause the current thread to wait until notified. |
void |
goToSleep(long time)
Cause the current thread to wait until notified or the specified time has passed, whichever comes first. |
void |
goToSleep(long millis,
int nanos)
Cause the current thread to wait until notified or the specified time has passed, whichever comes first. |
boolean |
isStopped()
Determine whether the thread's run() method is terminated. |
void |
setStopped(boolean stopped)
Specifiy whether the thread's run() should terminate. |
void |
wakeUp()
Notify the threads currently waiting on this object that they can resume. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean stopped
| Constructor Detail |
|---|
public ThreadSynchronization()
| Method Detail |
|---|
public void goToSleep()
public void goToSleep(long time)
time - the maximum time to wait in milliseconds.
public void goToSleep(long millis,
int nanos)
millis - the maximum time to wait in milliseconds.nanos - the additional time to wait in nanoseconds.public void wakeUp()
public boolean isStopped()
run() method is terminated.
public void setStopped(boolean stopped)
run() should terminate.
stopped - true if the thread is to be stopped, false otherwise.
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||