public void postWindowRunnableAndWait(Runnable runnable) {
    synchronized (SYNC) {
      windowRunnablesWait = runnable;
    }

    while (windowRunnablesWait != null) {
      try {
        Thread.sleep(100);
      } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
  }