48 // This is full version of monitor enter and exit. I choose not
49 // to use enter() and exit() in order to make sure user be ware
50 // of the performance and semantics difference. They are normally
51 // used by ObjectLocker etc. The interpreter and compiler use
52 // assembly copies of these routines. Please keep them synchronized.
53 //
54 // attempt_rebias flag is used by UseBiasedLocking implementation
55 static void fast_enter(Handle obj, BasicLock* lock, bool attempt_rebias,
56 TRAPS);
57 static void fast_exit(oop obj, BasicLock* lock, Thread* THREAD);
58
59 // WARNING: They are ONLY used to handle the slow cases. They should
60 // only be used when the fast cases failed. Use of these functions
61 // without previous fast case check may cause fatal error.
62 static void slow_enter(Handle obj, BasicLock* lock, TRAPS);
63 static void slow_exit(oop obj, BasicLock* lock, Thread* THREAD);
64
65 // Used only to handle jni locks or other unmatched monitor enter/exit
66 // Internally they will use heavy weight monitor.
67 static void jni_enter(Handle obj, TRAPS);
68 static bool jni_try_enter(Handle obj, Thread* THREAD); // Implements Unsafe.tryMonitorEnter
69 static void jni_exit(oop obj, Thread* THREAD);
70
71 // Handle all interpreter, compiler and jni cases
72 static int wait(Handle obj, jlong millis, TRAPS);
73 static void notify(Handle obj, TRAPS);
74 static void notifyall(Handle obj, TRAPS);
75
76 // Special internal-use-only method for use by JVM infrastructure
77 // that needs to wait() on a java-level object but that can't risk
78 // throwing unexpected InterruptedExecutionExceptions.
79 static void waitUninterruptibly(Handle obj, jlong Millis, Thread * THREAD);
80
81 // used by classloading to free classloader object lock,
82 // wait on an internal lock, and reclaim original lock
83 // with original recursion count
84 static intptr_t complete_exit(Handle obj, TRAPS);
85 static void reenter (Handle obj, intptr_t recursion, TRAPS);
86
87 // thread-specific and global objectMonitor free list accessors
88 static void verifyInUse(Thread * Self);
|
48 // This is full version of monitor enter and exit. I choose not
49 // to use enter() and exit() in order to make sure user be ware
50 // of the performance and semantics difference. They are normally
51 // used by ObjectLocker etc. The interpreter and compiler use
52 // assembly copies of these routines. Please keep them synchronized.
53 //
54 // attempt_rebias flag is used by UseBiasedLocking implementation
55 static void fast_enter(Handle obj, BasicLock* lock, bool attempt_rebias,
56 TRAPS);
57 static void fast_exit(oop obj, BasicLock* lock, Thread* THREAD);
58
59 // WARNING: They are ONLY used to handle the slow cases. They should
60 // only be used when the fast cases failed. Use of these functions
61 // without previous fast case check may cause fatal error.
62 static void slow_enter(Handle obj, BasicLock* lock, TRAPS);
63 static void slow_exit(oop obj, BasicLock* lock, Thread* THREAD);
64
65 // Used only to handle jni locks or other unmatched monitor enter/exit
66 // Internally they will use heavy weight monitor.
67 static void jni_enter(Handle obj, TRAPS);
68 static void jni_exit(oop obj, Thread* THREAD);
69
70 // Handle all interpreter, compiler and jni cases
71 static int wait(Handle obj, jlong millis, TRAPS);
72 static void notify(Handle obj, TRAPS);
73 static void notifyall(Handle obj, TRAPS);
74
75 // Special internal-use-only method for use by JVM infrastructure
76 // that needs to wait() on a java-level object but that can't risk
77 // throwing unexpected InterruptedExecutionExceptions.
78 static void waitUninterruptibly(Handle obj, jlong Millis, Thread * THREAD);
79
80 // used by classloading to free classloader object lock,
81 // wait on an internal lock, and reclaim original lock
82 // with original recursion count
83 static intptr_t complete_exit(Handle obj, TRAPS);
84 static void reenter (Handle obj, intptr_t recursion, TRAPS);
85
86 // thread-specific and global objectMonitor free list accessors
87 static void verifyInUse(Thread * Self);
|