|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectnet.sf.jauvm.Monitor
public class Monitor
Contains methods used to synchronize access to objects.
| Constructor Summary | |
|---|---|
protected |
Monitor()
|
| Method Summary | |
|---|---|
static void |
enter(Object obj)
Acquires the monitor for an object. |
static void |
exit(Object obj)
Releases the monitor for an object. |
static void |
notify(Object obj)
Notifies a single thread that is waiting on an object's monitor. |
static void |
notifyAll(Object obj)
Notifies all threads that are waiting on an object's monitor. |
static void |
wait(Object obj)
Waits to be notified on an object. |
static void |
wait(Object obj,
long timeout,
TimeUnit unit)
Waits to be notified on an object or until a specified amount of of time elapses. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected Monitor()
| Method Detail |
|---|
public static void enter(Object obj)
UnsupportedOperationException. See the java.util.concurrent.locks package for alternative
synchronization mechanisms.
obj - the object on which to acquire the monitor lock
NullPointerException - if obj is null
UnsupportedOperationException - if this operation is not supported by the current JVMjava.util.concurrent.lockspublic static void exit(Object obj)
UnsupportedOperationException. See the java.util.concurrent.locks package for alternative
synchronization mechanisms.
obj - the object on which to acquire the monitor lock
NullPointerException - if obj is null
IllegalMonitorStateException - if the current thread does not hold the lock on obj
UnsupportedOperationException - if this operation is not supported by the current JVMjava.util.concurrent.lockspublic static void notify(Object obj)
notify() method.
obj - the object a thread is waiting forObject.notify()public static void notifyAll(Object obj)
notifyAll() method.
obj - the object threads are waiting forObject.notifyAll()
public static void wait(Object obj)
throws InterruptedException
wait() method.
obj - the object on which to wait
InterruptedExceptionObject.wait()
public static void wait(Object obj,
long timeout,
TimeUnit unit)
throws InterruptedException
unit.timedWait(obj, time).
obj - the object on which to waittimeout - the maximum time to waitunit - the time util of timeout
InterruptedExceptionTimeUnit.timedWait(Object, long)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||