< prev index next >
src/hotspot/share/utilities/singleWriterSynchronizer.hpp
Print this page
@@ -87,15 +87,15 @@
// RAII class for managing enter/exit pairs.
class CriticalSection;
};
inline uint SingleWriterSynchronizer::enter() {
- return Atomic::add(2u, &_enter);
+ return Atomic::add(&_enter, 2u);
}
inline void SingleWriterSynchronizer::exit(uint enter_value) {
- uint exit_value = Atomic::add(2u, &_exit[enter_value & 1]);
+ uint exit_value = Atomic::add(&_exit[enter_value & 1], 2u);
// If this exit completes a synchronize request, wakeup possibly
// waiting synchronizer. Read of _waiting_for must follow the _exit
// update.
if (exit_value == _waiting_for) {
_wakeup.signal();
< prev index next >