/** * Suspends the update manager. */ public synchronized void suspend() { // System.err.println("Suspend: " + suspendCalled + " : " + running); if (updateRunnableQueue.getQueueState() == RunnableQueue.RUNNING) { updateRunnableQueue.suspendExecution(false); } suspendCalled = true; }
/** * Suspends the update manager. */ public synchronized void suspend() { // System.err.println("Suspend: " + suspendCalled + " : " + running); if (updateRunnableQueue.getQueueState() == RunnableQueue.RUNNING) { updateRunnableQueue.suspendExecution(false); } suspendCalled = true; }
/** * Suspends the update manager. */ public synchronized void suspend() { // System.err.println("Suspend: " + suspendCalled + " : " + running); if (updateRunnableQueue.getQueueState() == RunnableQueue.RUNNING) { updateRunnableQueue.suspendExecution(false); } suspendCalled = true; }
public void run() { boolean suspendp, waitp; int time; while (true) { try { synchronized (rand) { suspendp = rand.nextBoolean(); waitp = rand.nextBoolean(); time = rand.nextInt(500); } if (suspendp) { // 1/2 of the time suspend, 1/2 time wait, 1/2 the // time don't rq.suspendExecution(waitp); System.out.println("Suspended - " + (waitp?"Wait":"Later")); Thread.sleep(time/10); } else { // 1/2 the time resume rq.resumeExecution(); System.out.println("Resumed"); Thread.sleep(time); } } catch(InterruptedException ie) { } } } }