< prev index next >

src/hotspot/share/utilities/waitBarrier_generic.cpp

Print this page

        

*** 80,94 **** if (barrier_tag != _barrier_tag) { // API specifies wait() must provide a trailing fence. OrderAccess::fence(); return; } ! Atomic::add(1, &_barrier_threads); if (barrier_tag != 0 && barrier_tag == _barrier_tag) { ! Atomic::add(1, &_waiters); _sem_barrier.wait(); // We help out with posting, but we need to do so before we decrement the // _barrier_threads otherwise we might wake threads up in next wait. GenericWaitBarrier::wake_if_needed(); } ! Atomic::add(-1, &_barrier_threads); } --- 80,94 ---- if (barrier_tag != _barrier_tag) { // API specifies wait() must provide a trailing fence. OrderAccess::fence(); return; } ! Atomic::add(&_barrier_threads, 1); if (barrier_tag != 0 && barrier_tag == _barrier_tag) { ! Atomic::add(&_waiters, 1); _sem_barrier.wait(); // We help out with posting, but we need to do so before we decrement the // _barrier_threads otherwise we might wake threads up in next wait. GenericWaitBarrier::wake_if_needed(); } ! Atomic::add(&_barrier_threads, -1); }
< prev index next >