public static void waitfor(FullWait fw, int val, long limit) throws InterruptedException { System.out.println("about to waitUntilAtLeast(" + val + ", " + limit + ") ... "); long startTime = System.currentTimeMillis(); boolean retVal = fw.waitUntilAtLeast(val, limit); long endTime = System.currentTimeMillis(); System.out.println( "waited for " + (endTime - startTime) + " ms, retVal=" + retVal + "\n---------------"); }
private void runWork() { int count = 6; while (noStopRequested) { fullwait.setValue(count); System.out.println("just set value to " + count); count++; try { Thread.sleep(1000); } catch (InterruptedException x) { // reassert interrupt Thread.currentThread().interrupt(); } } }