// printFirst.run() outputs "first". Do not change or remove this line. printFirst.run(); two.release(); }
publicvoidsecond(Runnable printSecond)throws InterruptedException { two.acquire(); // printSecond.run() outputs "second". Do not change or remove this line. printSecond.run(); three.release(); }
publicvoidthird(Runnable printThird)throws InterruptedException { three.acquire(); // printThird.run() outputs "third". Do not change or remove this line. printThird.run(); } }