Indentation and comment refinement

This commit is contained in:
Viktor Klang 2026-06-09 21:13:04 +02:00
parent 1f0ce1e735
commit 70e4bc9708
2 changed files with 6 additions and 6 deletions

View File

@ -833,7 +833,7 @@ public abstract class AbstractQueuedSynchronizer
if ((s == null ? casTail(q, p) : s.casPrev(q, p)) &&
q.prev == p) {
if (s != null)
p.casNext(q, s); // OK if fails
p.casNext(q, s); // OK if fails
if (p.prev == null)
signalNext(p);
}

View File

@ -698,13 +698,13 @@ public class SemaphoreTest extends JSR166TestCase {
for(int i = 0; i < width; ++i)
pool.submit(c);
waitingToRun.await(); // Wait for all threads to have launched their tasks
Thread.sleep(3000); // Give the workers a bit of time to run acquisitions
s.release(width); // Hand out permits
Thread.sleep(1000); // Give the workers a bit of time to react to the availability of permits
waitingToRun.await(); // Wait for all tasks to start
Thread.sleep(3000); // Wait a while for acquisitions
s.release(width); // Hand out permits
Thread.sleep(1000); // Wait a while for permit acquisitions
final int permitsAvailable = s.availablePermits();
done.set(true); // Try to make sure that for the successful cases the workers can exit cleanly
done.set(true); // Ensure that tasks can exit
assertTrue(permitsAvailable < width); // Some permits should've been taken
}
}