Beispiel #1
0
 /**
  * Wakes up a single thread that is waiting on this object's monitor. If any threads are waiting
  * on this object, one of them is chosen to be awakened. The choice is arbitrary and occurs at the
  * discretion of the implementation. A thread waits on an object's monitor by calling one of the
  * <code>wait</code> methods.
  *
  * <p>The awakened thread will not be able to proceed until the current thread relinquishes the
  * lock on this object. The awakened thread will compete in the usual manner with any other
  * threads that might be actively competing to synchronize on this object; for example, the
  * awakened thread enjoys no reliable privilege or disadvantage in being the next thread to lock
  * this object.
  *
  * <p>This method should only be called by a thread that is the owner of this object's monitor. A
  * thread becomes the owner of the object's monitor in one of three ways:
  *
  * <ul>
  *   <li>By executing a synchronized instance method of that object.
  *   <li>By executing the body of a <code>synchronized</code> statement that synchronizes on the
  *       object.
  *   <li>For objects of type <code>Class,</code> by executing a synchronized static method of that
  *       class.
  * </ul>
  *
  * <p>Only one thread at a time can own an object's monitor.
  *
  * @exception IllegalMonitorStateException if the current thread is not the owner of this object's
  *     monitor.
  * @see java.lang.Object#notifyAll()
  * @see java.lang.Object#wait()
  */
 public final void notify() {
   com.sun.squawk.VMThread.monitorNotify(this, false);
 }
Beispiel #2
0
 /**
  * Wakes up all threads that are waiting on this object's monitor. A thread waits on an object's
  * monitor by calling one of the <code>wait</code> methods.
  *
  * <p>The awakened threads will not be able to proceed until the current thread relinquishes the
  * lock on this object. The awakened threads will compete in the usual manner with any other
  * threads that might be actively competing to synchronize on this object; for example, the
  * awakened threads enjoy no reliable privilege or disadvantage in being the next thread to lock
  * this object.
  *
  * <p>This method should only be called by a thread that is the owner of this object's monitor.
  * See the <code>notify</code> method for a description of the ways in which a thread can become
  * the owner of a monitor.
  *
  * @exception IllegalMonitorStateException if the current thread is not the owner of this object's
  *     monitor.
  * @see java.lang.Object#notify()
  * @see java.lang.Object#wait()
  */
 public final void notifyAll() {
   com.sun.squawk.VMThread.monitorNotify(this, true);
 }