< prev index next >

src/share/vm/runtime/mutex.hpp

Print this page
rev 13131 : [mq]: G1LockOrderProblems

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2017, 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.

@@ -91,10 +91,14 @@
  public:
   // A special lock: Is a lock where you are guaranteed not to block while you are
   // holding it, i.e., no vm operation can happen, taking other locks, etc.
   // NOTE: It is critical that the rank 'special' be the lowest (earliest)
   // (except for "event"?) for the deadlock detection to work correctly.
+  // The rank access is reserved for locks that may be required to perform
+  // memory accesses that require special GC barriers, such as SATB barriers.
+  // Since memory accesses should be able to be performed pretty much anywhere
+  // in the code, that wannts being more special than the "special" rank.
   // The rank native is only for use in Mutex's created by JVM_RawMonitorCreate,
   // which being external to the VM are not subject to deadlock detection.
   // The rank safepoint is used only for synchronization in reaching a
   // safepoint and leaving a safepoint.  It is only used for the Safepoint_lock
   // currently.  While at a safepoint no mutexes of rank safepoint are held

@@ -102,12 +106,13 @@
   // The rank named "leaf" is probably historical (and should
   // be changed) -- mutexes of this rank aren't really leaf mutexes
   // at all.
   enum lock_types {
        event,
-       special,
-       suspend_resume,
+       access         = event          +   1,
+       special        = access         +   2,
+       suspend_resume = special        +   1,
        leaf        = suspend_resume +   2,
        safepoint   = leaf           +  10,
        barrier     = safepoint      +   1,
        nonleaf     = barrier        +   1,
        max_nonleaf = nonleaf        + 900,
< prev index next >