< prev index next >
src/hotspot/share/runtime/basicLock.cpp
Print this page
rev 54612 : Checkpoint latest preliminary review patches for full OpenJDK review; merge with 8222295.patch.
@@ -22,10 +22,11 @@
*
*/
#include "precompiled.hpp"
#include "runtime/basicLock.hpp"
+#include "runtime/objectMonitor.hpp"
#include "runtime/synchronizer.hpp"
void BasicLock::print_on(outputStream* st) const {
st->print("monitor");
markOop moop = displaced_header();
@@ -60,12 +61,15 @@
// we need to ensure that both locations refer to the current thread's stack.
// There are some subtle concurrency issues, however, and since the benefit is
// is small (given the support for inflated fast-path locking in the fast_lock, etc)
// we'll leave that optimization for another time.
+ // Disallow async deflation of the inflated monitor so the
+ // displaced header stays stable until we've copied it.
+ ObjectMonitorHandle omh;
if (displaced_header()->is_neutral()) {
- ObjectSynchronizer::inflate_helper(obj);
+ ObjectSynchronizer::inflate_helper(&omh, obj);
// WARNING: We can not put check here, because the inflation
// will not update the displaced header. Once BasicLock is inflated,
// no one should ever look at its content.
} else {
// Typically the displaced header will be 0 (recursive stack lock) or
< prev index next >