49 owner_self, 50 owner_none, 51 owner_other 52 } LockOwnership; 53 54 typedef enum { 55 inflate_cause_vm_internal = 0, 56 inflate_cause_monitor_enter = 1, 57 inflate_cause_wait = 2, 58 inflate_cause_notify = 3, 59 inflate_cause_hash_code = 4, 60 inflate_cause_jni_enter = 5, 61 inflate_cause_jni_exit = 6, 62 inflate_cause_nof = 7 // Number of causes 63 } InflateCause; 64 65 // exit must be implemented non-blocking, since the compiler cannot easily handle 66 // deoptimization at monitor exit. Hence, it does not take a Handle argument. 67 68 // This is full version of monitor enter and exit. 69 // The interpreter and compiler use assembly copies of these routines. 70 // Please keep them synchronized. 71 static void enter(Handle obj, BasicLock* lock, TRAPS); 72 static void exit(oop obj, BasicLock* lock, Thread* THREAD); 73 74 // Used only to handle jni locks or other unmatched monitor enter/exit 75 // Internally they will use heavy weight monitor. 76 static void jni_enter(Handle obj, TRAPS); 77 static void jni_exit(oop obj, Thread* THREAD); 78 79 // Handle all interpreter, compiler and jni cases 80 static int wait(Handle obj, jlong millis, TRAPS); 81 static void notify(Handle obj, TRAPS); 82 static void notifyall(Handle obj, TRAPS); 83 84 static bool quick_notify(oopDesc* obj, Thread* Self, bool All); 85 static bool quick_enter(oop obj, Thread* Self, BasicLock* Lock); 86 87 // Special internal-use-only method for use by JVM infrastructure 88 // that needs to wait() on a java-level object but that can't risk 89 // throwing unexpected InterruptedExecutionExceptions. 90 static void waitUninterruptibly(Handle obj, jlong Millis, Thread * THREAD); | 49 owner_self, 50 owner_none, 51 owner_other 52 } LockOwnership; 53 54 typedef enum { 55 inflate_cause_vm_internal = 0, 56 inflate_cause_monitor_enter = 1, 57 inflate_cause_wait = 2, 58 inflate_cause_notify = 3, 59 inflate_cause_hash_code = 4, 60 inflate_cause_jni_enter = 5, 61 inflate_cause_jni_exit = 6, 62 inflate_cause_nof = 7 // Number of causes 63 } InflateCause; 64 65 // exit must be implemented non-blocking, since the compiler cannot easily handle 66 // deoptimization at monitor exit. Hence, it does not take a Handle argument. 67 68 // This is full version of monitor enter and exit. 69 static void enter(Handle obj, BasicLock* lock, TRAPS); 70 static void exit(oop obj, BasicLock* lock, Thread* THREAD); 71 72 // Used only to handle jni locks or other unmatched monitor enter/exit 73 // Internally they will use heavy weight monitor. 74 static void jni_enter(Handle obj, TRAPS); 75 static void jni_exit(oop obj, Thread* THREAD); 76 77 // Handle all interpreter, compiler and jni cases 78 static int wait(Handle obj, jlong millis, TRAPS); 79 static void notify(Handle obj, TRAPS); 80 static void notifyall(Handle obj, TRAPS); 81 82 static bool quick_notify(oopDesc* obj, Thread* Self, bool All); 83 static bool quick_enter(oop obj, Thread* Self, BasicLock* Lock); 84 85 // Special internal-use-only method for use by JVM infrastructure 86 // that needs to wait() on a java-level object but that can't risk 87 // throwing unexpected InterruptedExecutionExceptions. 88 static void waitUninterruptibly(Handle obj, jlong Millis, Thread * THREAD); |