< prev index next >

src/hotspot/share/runtime/synchronizer.hpp

Print this page

 62 
 63 public:
 64   Iterator(ObjectMonitor* head) : _current(head) {}
 65   bool has_next() const { return _current != nullptr; }
 66   ObjectMonitor* next();
 67 };
 68 
 69 class ObjectSynchronizer : AllStatic {
 70   friend class VMStructs;
 71   friend class ObjectMonitorDeflationLogging;
 72 
 73  public:
 74   typedef enum {
 75     inflate_cause_vm_internal = 0,
 76     inflate_cause_monitor_enter = 1,
 77     inflate_cause_wait = 2,
 78     inflate_cause_notify = 3,
 79     inflate_cause_hash_code = 4,
 80     inflate_cause_jni_enter = 5,
 81     inflate_cause_jni_exit = 6,
 82     inflate_cause_nof = 7 // Number of causes

 83   } InflateCause;
 84 
 85   typedef enum {
 86     NOT_ENABLED    = 0,
 87     FATAL_EXIT     = 1,
 88     LOG_WARNING    = 2
 89   } SyncDiagnosticOption;
 90 
 91   // exit must be implemented non-blocking, since the compiler cannot easily handle
 92   // deoptimization at monitor exit. Hence, it does not take a Handle argument.
 93 
 94   // This is the "slow path" version of monitor enter and exit.
 95   static void enter(Handle obj, BasicLock* lock, JavaThread* current);
 96   static void exit(oop obj, BasicLock* lock, JavaThread* current);
 97   // Used to enter a monitor for another thread. This requires that the
 98   // locking_thread is suspended, and that entering on a potential
 99   // inflated monitor may only contend with deflation. That is the obj being
100   // locked on is either already locked by the locking_thread or cannot
101   // escape the locking_thread.
102   static void enter_for(Handle obj, BasicLock* lock, JavaThread* locking_thread);

 62 
 63 public:
 64   Iterator(ObjectMonitor* head) : _current(head) {}
 65   bool has_next() const { return _current != nullptr; }
 66   ObjectMonitor* next();
 67 };
 68 
 69 class ObjectSynchronizer : AllStatic {
 70   friend class VMStructs;
 71   friend class ObjectMonitorDeflationLogging;
 72 
 73  public:
 74   typedef enum {
 75     inflate_cause_vm_internal = 0,
 76     inflate_cause_monitor_enter = 1,
 77     inflate_cause_wait = 2,
 78     inflate_cause_notify = 3,
 79     inflate_cause_hash_code = 4,
 80     inflate_cause_jni_enter = 5,
 81     inflate_cause_jni_exit = 6,
 82     inflate_cause_cont_freeze = 7,
 83     inflate_cause_nof = 8 // Number of causes
 84   } InflateCause;
 85 
 86   typedef enum {
 87     NOT_ENABLED    = 0,
 88     FATAL_EXIT     = 1,
 89     LOG_WARNING    = 2
 90   } SyncDiagnosticOption;
 91 
 92   // exit must be implemented non-blocking, since the compiler cannot easily handle
 93   // deoptimization at monitor exit. Hence, it does not take a Handle argument.
 94 
 95   // This is the "slow path" version of monitor enter and exit.
 96   static void enter(Handle obj, BasicLock* lock, JavaThread* current);
 97   static void exit(oop obj, BasicLock* lock, JavaThread* current);
 98   // Used to enter a monitor for another thread. This requires that the
 99   // locking_thread is suspended, and that entering on a potential
100   // inflated monitor may only contend with deflation. That is the obj being
101   // locked on is either already locked by the locking_thread or cannot
102   // escape the locking_thread.
103   static void enter_for(Handle obj, BasicLock* lock, JavaThread* locking_thread);
< prev index next >