< prev index next >

src/hotspot/share/prims/jvmtiRawMonitor.cpp

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 165,180 **** _EntryList = w->_next ; } RawMonitor_lock->unlock() ; if (w != NULL) { guarantee (w ->TState == ObjectWaiter::TS_ENTER, "invariant") ; - // Once we set TState to TS_RUN the waiting thread can complete - // SimpleEnter and 'w' is pointing into random stack space. So we have - // to ensure we extract the ParkEvent (which is in type-stable memory) - // before we set the state, and then don't access 'w'. ParkEvent * ev = w->_event ; - OrderAccess::loadstore(); w->TState = ObjectWaiter::TS_RUN ; OrderAccess::fence() ; ev->unpark() ; } return OS_OK ; --- 165,175 ----
*** 203,213 **** ret = Self->_ParkEvent->park(millis); } // If thread still resides on the waitset then unlink it. // Double-checked locking -- the usage is safe in this context ! // as TState is volatile and the lock-unlock operators are // serializing (barrier-equivalent). if (Node.TState == ObjectWaiter::TS_WAIT) { RawMonitor_lock->lock_without_safepoint_check() ; if (Node.TState == ObjectWaiter::TS_WAIT) { --- 198,208 ---- ret = Self->_ParkEvent->park(millis); } // If thread still resides on the waitset then unlink it. // Double-checked locking -- the usage is safe in this context ! // as we TState is volatile and the lock-unlock operators are // serializing (barrier-equivalent). if (Node.TState == ObjectWaiter::TS_WAIT) { RawMonitor_lock->lock_without_safepoint_check() ; if (Node.TState == ObjectWaiter::TS_WAIT) {
< prev index next >