Queue an "event" to be run on the GL rendering thread.

@param r
the runnable to be run on the GL rendering thread.
566
public void queueEvent(Runnable r) {
                synchronized (this) {
                        mEventQueue.add(r);
                        synchronized (sGLThreadManager) {
                                mEventsWaiting = true;
                                sGLThreadManager.notifyAll();
                        }
                }
        }
1141605
public static void runIntoJAT(final JRebirthRunnable runnable) {
        if (Platform.isFxApplicationThread()) {
            // We are into a JAT so just run it synchronously
            runnable.run();
        } else {
            // The runnable will be run into the JAT during the next round
            Platform.runLater(runnable);
        }
    }
863039
public static void fireFinalized(Run r) {
        if (Jenkins.getInstanceOrNull() == null) { // TODO use !Functions.isExtensionsAvailable() once JENKINS-33377
            return;
        }
        for (RunListener l : all()) {
            if(l.targetType.isInstance(r))
                try {
                    l.onFinalized(r);
                } catch (Throwable e) {
                    report(e);
                }
        }
    }
1223309
public void run(Runnable r) {
    Context previous = attach();
    try {
      r.run();
    } finally {
      detach(previous);
    }
  }
944666
public void startLWJGL() {
      if (gameThread != null) {
         return;
      }
      
      gameThread = new Thread() {
         public void run() {
            try {
               canvas.start();
            }
            catch (Exception e) {
               e.printStackTrace();
               if (Display.isCreated()) {
                  Display.destroy();
               }
               displayParent.setVisible(false);//removeAll();
               add(new ConsolePanel(e));
               validate();
            }
         }
      };
      
      gameThread.start();
   }
1213449
public static void fireDeleted(Run r) {
        for (RunListener l : all()) {
            if(l.targetType.isInstance(r))
                try {
                    l.onDeleted(r);
                } catch (Throwable e) {
                    report(e);
                }
        }
    }
373712
protected final void synchronizedRedraw() {
    Runnable pr = new Runnable() {
      @Override
      public void run() {
        if(VisualizationPlot.this.pendingRedraw == this) {
          VisualizationPlot.this.pendingRedraw = null;
          VisualizationPlot.this.redraw();
        }
      }
    };
    pendingRedraw = pr;
    scheduleUpdate(pr);
  }
486355
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
		rpcServer.scheduleRunAsync(runnable, unit.toMillis(delay));
	}
1120734
public void run ()
    {
        log.info("DOMGR running.");

        // make a note of the thread that's processing events
        synchronized (this) {
            _dobjThread = Thread.currentThread();
        }

        while (isRunning()) {
            // pop the next unit off the queue and process it
            processUnit(_evqueue.get());
        }

        log.info("DOMGR exited.");
    }
133895
protected void scheduleRunAsync(Runnable runnable, Time delay) {
		scheduleRunAsync(runnable, delay.getSize(), delay.getUnit());
	}
1076094
public static <T> T queueAndWait (
        RunQueue runq, final String name, final Callable<T> action)
        throws ServiceException
    {
        final ServletWaiter<T> waiter = new ServletWaiter<T>(name);
        runq.postRunnable(new Runnable() {
            public void run () {
                try {
                    waiter.postSuccess(action.call());
                } catch (final Exception e) {
                    waiter.postFailure(e);
                }
            }
        });
        return waiter.waitForResult();
    }
371167
public void doBackgroundOp( final Runnable run, final boolean showWaitCursor )
  {
    final Component[] key = new Component[1];
    ExecutorService jobRunner = getJobRunner();
    if( jobRunner != null )
    {
      jobRunner.submit( () -> performBackgroundOp( run, key, showWaitCursor ) );
    }
    else
    {
      run.run();
    }
  }
1238387
protected void scheduleRunAsync(Runnable runnable, long delay, TimeUnit unit) {
		componentMainThreadExecutor.schedule(runnable, delay, unit);
	}
749594
@Override
    public Thread newThread(Runnable runnable) {
        Thread thread = new Thread(runnable);
        thread.setPriority(threadPriority);
        return thread;
    }
714105
public void run()
    {
        // Note: To make sure the user gets a chance to see the
        // html text, we wait for a paint before returing.
        // Since these threads are stacked in a private thread queue, the next
        // thread is not executed until this one is finished.
            if (! EventQueue.isDispatchThread() 
)//            && Runtime.getRuntime().availableProcessors() == 1)
        {
            if (!m_syncPage.isPaintCalled())
            {   // Wait for the previous call to finish
                synchronized (m_syncPage) {
                    while (!m_syncPage.isPaintCalled()) {
                        try { m_syncPage.wait(); } catch (InterruptedException e) {}
                    }
                }
            }
            synchronized (m_syncPage) {
                m_syncPage.setPaintCalled(false);

                this.runPageLoader();

                while (!m_syncPage.isPaintCalled()) {
                    try { m_syncPage.wait(); } catch (InterruptedException e) {}
                }
                
                this.afterPageDisplay();
            }
        }
    }
1219275
public void execute(final T runnable) {
        synchronized (queue) {
            if (runnable != null && !disabled) {
                queue.addLast(runnable);
                queue.notify();
                System.out.println("WorkQueue has added runable - WorkQueue size is " + queue.size());
            }
        }
    }
451370
public Thread newThread(Runnable r) {
        return factory == this ? new Thread(r)
                               : factory.newThread(r);
    }