--- old/src/hotspot/share/utilities/waitBarrier_generic.cpp 2018-12-18 11:15:44.130359016 +0100 +++ new/src/hotspot/share/utilities/waitBarrier_generic.cpp 2018-12-18 11:15:43.807347403 +0100 @@ -52,8 +52,8 @@ return 0; } assert(w > 0, "Bad counting"); - // We need an exact count and never go below 0. - // Otherwise the semaphore might contain to many posts. + // We need an exact count which never goes below zero, + // otherwise the semaphore may be signalled too many times. if (Atomic::cmpxchg(w - 1, &_waiters, w) == w) { _sem_barrier.signal(); return w - 1; @@ -71,7 +71,7 @@ // There is no thread to wake but we still have barrier threads. sp.wait(); } - // We must loop here until there is no waiters or potential waiters. + // We must loop here until there are no waiters or potential waiters. } while (left > 0 || _barrier_threads > 0); OrderAccess::fence(); }