src/hotspot/share/runtime/mutex.hpp
changeset 52913 bf2f2560dd53
parent 52555 3b2d22602c16
child 53244 9807daeb47c4
equal deleted inserted replaced
52912:f94276ccc9fc 52913:bf2f2560dd53
    85   // A special lock: Is a lock where you are guaranteed not to block while you are
    85   // A special lock: Is a lock where you are guaranteed not to block while you are
    86   // holding it, i.e., no vm operation can happen, taking other (blocking) locks, etc.
    86   // holding it, i.e., no vm operation can happen, taking other (blocking) locks, etc.
    87   // The rank 'access' is similar to 'special' and has the same restrictions on usage.
    87   // The rank 'access' is similar to 'special' and has the same restrictions on usage.
    88   // It is reserved for locks that may be required in order to perform memory accesses
    88   // It is reserved for locks that may be required in order to perform memory accesses
    89   // that require special barriers, e.g. SATB GC barriers, that in turn uses locks.
    89   // that require special barriers, e.g. SATB GC barriers, that in turn uses locks.
       
    90   // The rank 'tty' is also similar to 'special' and has the same restrictions.
       
    91   // It is reserved for the tty_lock.
    90   // Since memory accesses should be able to be performed pretty much anywhere
    92   // Since memory accesses should be able to be performed pretty much anywhere
    91   // in the code, that requires locks required for performing accesses being
    93   // in the code, that requires locks required for performing accesses being
    92   // inherently a bit more special than even locks of the 'special' rank.
    94   // inherently a bit more special than even locks of the 'special' rank.
    93   // NOTE: It is critical that the rank 'special' be the lowest (earliest)
    95   // NOTE: It is critical that the rank 'special' be the lowest (earliest)
    94   // (except for "event" and "access") for the deadlock detection to work correctly.
    96   // (except for "event" and "access") for the deadlock detection to work correctly.
   102   // be changed) -- mutexes of this rank aren't really leaf mutexes
   104   // be changed) -- mutexes of this rank aren't really leaf mutexes
   103   // at all.
   105   // at all.
   104   enum lock_types {
   106   enum lock_types {
   105        event,
   107        event,
   106        access         = event          +   1,
   108        access         = event          +   1,
   107        special        = access         +   2,
   109        tty            = access         +   2,
       
   110        special        = tty            +   1,
   108        suspend_resume = special        +   1,
   111        suspend_resume = special        +   1,
   109        vmweak         = suspend_resume +   2,
   112        vmweak         = suspend_resume +   2,
   110        leaf           = vmweak         +   2,
   113        leaf           = vmweak         +   2,
   111        safepoint      = leaf           +  10,
   114        safepoint      = leaf           +  10,
   112        barrier        = safepoint      +   1,
   115        barrier        = safepoint      +   1,
   234 
   237 
   235   void print_on_error(outputStream* st) const;
   238   void print_on_error(outputStream* st) const;
   236 
   239 
   237   #ifndef PRODUCT
   240   #ifndef PRODUCT
   238     void print_on(outputStream* st) const;
   241     void print_on(outputStream* st) const;
   239     void print() const                      { print_on(tty); }
   242     void print() const                      { print_on(::tty); }
   240     DEBUG_ONLY(int    rank() const          { return _rank; })
   243     DEBUG_ONLY(int    rank() const          { return _rank; })
   241     bool   allow_vm_block()                 { return _allow_vm_block; }
   244     bool   allow_vm_block()                 { return _allow_vm_block; }
   242 
   245 
   243     DEBUG_ONLY(Monitor *next()  const         { return _next; })
   246     DEBUG_ONLY(Monitor *next()  const         { return _next; })
   244     DEBUG_ONLY(void   set_next(Monitor *next) { _next = next; })
   247     DEBUG_ONLY(void   set_next(Monitor *next) { _next = next; })