src/hotspot/share/runtime/mutex.hpp
changeset 57751 7284b00e6db3
parent 57668 33b160ef735c
child 57840 4863a802a7c1
equal deleted inserted replaced
57749:ececb6dae777 57751:7284b00e6db3
    50   // Since memory accesses should be able to be performed pretty much anywhere
    50   // Since memory accesses should be able to be performed pretty much anywhere
    51   // in the code, that requires locks required for performing accesses being
    51   // in the code, that requires locks required for performing accesses being
    52   // inherently a bit more special than even locks of the 'special' rank.
    52   // inherently a bit more special than even locks of the 'special' rank.
    53   // NOTE: It is critical that the rank 'special' be the lowest (earliest)
    53   // NOTE: It is critical that the rank 'special' be the lowest (earliest)
    54   // (except for "event" and "access") for the deadlock detection to work correctly.
    54   // (except for "event" and "access") for the deadlock detection to work correctly.
    55   // The rank native is only for use in Mutex's created by JVM_RawMonitorCreate,
    55   // The rank native was only for use in Mutexes created by JVM_RawMonitorCreate,
    56   // which being external to the VM are not subject to deadlock detection.
    56   // which being external to the VM are not subject to deadlock detection,
       
    57   // however it has now been used by other locks that don't fit into the
       
    58   // deadlock detection scheme.
    57   // While at a safepoint no mutexes of rank safepoint are held by any thread.
    59   // While at a safepoint no mutexes of rank safepoint are held by any thread.
    58   // The rank named "leaf" is probably historical (and should
    60   // The rank named "leaf" is probably historical (and should
    59   // be changed) -- mutexes of this rank aren't really leaf mutexes
    61   // be changed) -- mutexes of this rank aren't really leaf mutexes
    60   // at all.
    62   // at all.
    61   enum lock_types {
    63   enum lock_types {
   172   // Current owner - not not MT-safe. Can only be used to guarantee that
   174   // Current owner - not not MT-safe. Can only be used to guarantee that
   173   // the current running thread owns the lock
   175   // the current running thread owns the lock
   174   Thread* owner() const         { return _owner; }
   176   Thread* owner() const         { return _owner; }
   175   bool owned_by_self() const;
   177   bool owned_by_self() const;
   176 
   178 
   177   // Support for JVM_RawMonitorEnter & JVM_RawMonitorExit. These can be called by
       
   178   // non-Java thread. (We should really have a RawMonitor abstraction)
       
   179   void jvm_raw_lock();
       
   180   void jvm_raw_unlock();
       
   181   const char *name() const                  { return _name; }
   179   const char *name() const                  { return _name; }
   182 
   180 
   183   void print_on_error(outputStream* st) const;
   181   void print_on_error(outputStream* st) const;
   184 
   182 
   185   #ifndef PRODUCT
   183   #ifndef PRODUCT