203204205206207208209210211212213
// Synchronize on the scheduler. Scheduler scheduler = getScheduler(); synchronized (scheduler) { try { scheduler.wait(timeToWait); } catch (InterruptedException ex) { // Continue executing. } } }