wait();
queue.wait();
  public void run()  {    while (true)      {        Runnable r;        synchronized (queue)          {            while (queue.size() == 0)              {                try                  {                    wait();                  }                catch (InterruptedException _)                  {                    // Ignore.                  }              }            r = (Runnable) queue.remove(0);          }        // Invoke outside the synchronization, so that         // we aren't blocking other threads from posting events.        try          {            r.run();          }        catch (Throwable _)          {            // Ignore.          }      }  }