Lines Matching defs:thread

61   HandleMarkCleaner(Thread* thread) {
62 _thread = thread;
128 // Basic class for all thread transition classes.
134 ThreadStateTransition(JavaThread *thread) {
135 _thread = thread;
136 assert(thread != NULL && thread->is_Java_thread(), "must be Java thread");
141 static inline void transition(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
145 assert(thread->thread_state() == from, "coming from wrong thread state");
147 thread->set_thread_state((JavaThreadState)(from + 1));
149 // Make sure new state is seen by VM thread
155 // store to serialize page so VM thread can do pseudo remote membar
156 os::write_memory_serialize_page(thread);
161 SafepointSynchronize::block(thread);
163 thread->set_thread_state(to);
165 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
168 // transition_and_fence must be used on any thread state transition
174 static inline void transition_and_fence(JavaThread *thread, JavaThreadState from, JavaThreadState to) {
175 assert(thread->thread_state() == from, "coming from wrong thread state");
178 thread->set_thread_state((JavaThreadState)(from + 1));
180 // Make sure new state is seen by VM thread
187 InterfaceSupport::serialize_memory(thread);
192 SafepointSynchronize::block(thread);
194 thread->set_thread_state(to);
196 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
202 static inline void transition_from_java(JavaThread *thread, JavaThreadState to) {
203 assert(thread->thread_state() == _thread_in_Java, "coming from wrong thread state");
204 thread->set_thread_state(to);
207 static inline void transition_from_native(JavaThread *thread, JavaThreadState to) {
209 assert(thread->thread_state() == _thread_in_native, "coming from wrong thread state");
211 thread->set_thread_state(_thread_in_native_trans);
213 // Make sure new state is seen by GC thread
220 InterfaceSupport::serialize_memory(thread);
227 if (SafepointSynchronize::do_call_back() || thread->is_suspend_after_native()) {
228 JavaThread::check_safepoint_and_suspend_for_native_trans(thread);
231 CHECK_UNHANDLED_OOPS_ONLY(thread->clear_unhandled_oops();)
234 thread->set_thread_state(to);
246 ThreadInVMfromJava(JavaThread* thread) : ThreadStateTransition(thread) {
285 ThreadInVMfromNative(JavaThread* thread) : ThreadStateTransition(thread) {
296 ThreadToNativeFromVM(JavaThread *thread) : ThreadStateTransition(thread) {
299 assert(!thread->owns_locks(), "must release all locks when leaving VM");
300 thread->frame_anchor()->make_walkable(thread);
315 ThreadBlockInVM(JavaThread *thread)
316 : ThreadStateTransition(thread) {
318 thread->frame_anchor()->make_walkable(thread);
333 ThreadInVMfromJavaNoAsyncException(JavaThread* thread) : ThreadStateTransition(thread) {
445 #define VM_ENTRY_BASE(result_type, header, thread) \
447 HandleMarkCleaner __hm(thread); \
448 Thread* THREAD = thread; \
455 #define VM_QUICK_ENTRY_BASE(result_type, header, thread) \
458 Thread* THREAD = thread; \
464 // (thread is an argument passed in to all these routines)
468 ThreadInVMfromJava __tiv(thread); \
469 VM_ENTRY_BASE(result_type, header, thread) \
481 ThreadInVMfromJavaNoAsyncException __tiv(thread); \
482 VM_ENTRY_BASE(result_type, header, thread) \
492 ThreadInVMfromJavaNoAsyncException __tiv(thread); \
493 VM_ENTRY_BASE(result_type, header, thread)
502 ThreadInVMfromJava __tiv(thread); \
503 VM_ENTRY_BASE(result_type, header, thread) \
515 ThreadInVMfromJavaNoAsyncException __tiv(thread); \
516 VM_ENTRY_BASE(result_type, header, thread) \
524 HandleMarkCleaner __hm(thread);
528 ThreadInVMfromJava __tiv(thread); \
529 Thread* THREAD = thread; \
540 WeakPreserveExceptionMark __wem(thread);
545 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
546 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
547 ThreadInVMfromNative __tiv(thread); \
549 VM_ENTRY_BASE(result_type, header, thread)
557 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
558 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
559 ThreadInVMfromNative __tiv(thread); \
561 VM_QUICK_ENTRY_BASE(result_type, header, thread)
567 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
568 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \
582 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
583 ThreadInVMfromNative __tiv(thread); \
585 VM_ENTRY_BASE(result_type, header, thread)
591 JavaThread* thread = (JavaThread*)ThreadLocalStorage::thread(); \
592 ThreadInVMfromNative __tiv(thread); \
594 VM_ENTRY_BASE(result_type, header, thread)
600 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \
601 ThreadInVMfromNative __tiv(thread); \
603 VM_QUICK_ENTRY_BASE(result_type, header, thread)