TestingUtil.sleepThread(100);
sem.acquire(); // to read the uncommitted modification by t2
log("2nd read: value is " + value + "; we should see t2's uncommitted change (20)");
assertEquals(20, value); // we're seeing the modification by t2 before t2 committed (a.k.a. released the lock)
sem.release();
TestingUtil.sleepThread(100);
sem.acquire(); // to read the committed change by t2
log("3rd read: value is still " + value + "; we should see t2's committed change");
assertEquals(20, value);