73 static void notifyall (Handle obj, TRAPS); |
73 static void notifyall (Handle obj, TRAPS); |
74 |
74 |
75 // Special internal-use-only method for use by JVM infrastructure |
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 |
76 // that needs to wait() on a java-level object but that can't risk |
77 // throwing unexpected InterruptedExecutionExceptions. |
77 // throwing unexpected InterruptedExecutionExceptions. |
78 static void waitUninterruptibly (Handle obj, jlong Millis, Thread * THREAD) ; |
78 static void waitUninterruptibly(Handle obj, jlong Millis, Thread * THREAD); |
79 |
79 |
80 // used by classloading to free classloader object lock, |
80 // used by classloading to free classloader object lock, |
81 // wait on an internal lock, and reclaim original lock |
81 // wait on an internal lock, and reclaim original lock |
82 // with original recursion count |
82 // with original recursion count |
83 static intptr_t complete_exit (Handle obj, TRAPS); |
83 static intptr_t complete_exit (Handle obj, TRAPS); |
84 static void reenter (Handle obj, intptr_t recursion, TRAPS); |
84 static void reenter (Handle obj, intptr_t recursion, TRAPS); |
85 |
85 |
86 // thread-specific and global objectMonitor free list accessors |
86 // thread-specific and global objectMonitor free list accessors |
87 // static void verifyInUse (Thread * Self) ; too slow for general assert/debug |
87 // static void verifyInUse (Thread * Self) ; too slow for general assert/debug |
88 static ObjectMonitor * omAlloc (Thread * Self) ; |
88 static ObjectMonitor * omAlloc(Thread * Self); |
89 static void omRelease (Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc) ; |
89 static void omRelease(Thread * Self, ObjectMonitor * m, bool FromPerThreadAlloc); |
90 static void omFlush (Thread * Self) ; |
90 static void omFlush(Thread * Self); |
91 |
91 |
92 // Inflate light weight monitor to heavy weight monitor |
92 // Inflate light weight monitor to heavy weight monitor |
93 static ObjectMonitor* inflate(Thread * Self, oop obj); |
93 static ObjectMonitor* inflate(Thread * Self, oop obj); |
94 // This version is only for internal use |
94 // This version is only for internal use |
95 static ObjectMonitor* inflate_helper(oop obj); |
95 static ObjectMonitor* inflate_helper(oop obj); |
96 |
96 |
97 // Returns the identity hash value for an oop |
97 // Returns the identity hash value for an oop |
98 // NOTE: It may cause monitor inflation |
98 // NOTE: It may cause monitor inflation |
99 static intptr_t identity_hash_value_for(Handle obj); |
99 static intptr_t identity_hash_value_for(Handle obj); |
100 static intptr_t FastHashCode (Thread * Self, oop obj) ; |
100 static intptr_t FastHashCode(Thread * Self, oop obj); |
101 |
101 |
102 // java.lang.Thread support |
102 // java.lang.Thread support |
103 static bool current_thread_holds_lock(JavaThread* thread, Handle h_obj); |
103 static bool current_thread_holds_lock(JavaThread* thread, Handle h_obj); |
104 static LockOwnership query_lock_ownership(JavaThread * self, Handle h_obj); |
104 static LockOwnership query_lock_ownership(JavaThread * self, Handle h_obj); |
105 |
105 |
153 ~ObjectLocker(); |
153 ~ObjectLocker(); |
154 |
154 |
155 // Monitor behavior |
155 // Monitor behavior |
156 void wait (TRAPS) { ObjectSynchronizer::wait (_obj, 0, CHECK); } // wait forever |
156 void wait (TRAPS) { ObjectSynchronizer::wait (_obj, 0, CHECK); } // wait forever |
157 void notify_all(TRAPS) { ObjectSynchronizer::notifyall(_obj, CHECK); } |
157 void notify_all(TRAPS) { ObjectSynchronizer::notifyall(_obj, CHECK); } |
158 void waitUninterruptibly (TRAPS) { ObjectSynchronizer::waitUninterruptibly (_obj, 0, CHECK);} |
158 void waitUninterruptibly (TRAPS) { ObjectSynchronizer::waitUninterruptibly (_obj, 0, CHECK); } |
159 // complete_exit gives up lock completely, returning recursion count |
159 // complete_exit gives up lock completely, returning recursion count |
160 // reenter reclaims lock with original recursion count |
160 // reenter reclaims lock with original recursion count |
161 intptr_t complete_exit(TRAPS) { return ObjectSynchronizer::complete_exit(_obj, CHECK_0); } |
161 intptr_t complete_exit(TRAPS) { return ObjectSynchronizer::complete_exit(_obj, CHECK_0); } |
162 void reenter(intptr_t recursion, TRAPS) { ObjectSynchronizer::reenter(_obj, recursion, CHECK); } |
162 void reenter(intptr_t recursion, TRAPS) { ObjectSynchronizer::reenter(_obj, recursion, CHECK); } |
163 }; |
163 }; |