Lines Matching defs:thread
28 #include "thread.h"
46 Thread* thread = Thread::FromManagedThread(soa, java_thread);
47 return (thread != nullptr) ? thread->IsInterrupted() : JNI_FALSE;
52 // There are sections in the zygote that forbid thread creation.
61 Thread::CreateNativeThread(env, java_thread, stack_size, daemon == JNI_TRUE);
65 // Ordinals from Java's Thread.State.
76 Thread* thread = Thread::FromManagedThread(soa, java_thread);
77 if (thread != nullptr) {
78 internal_thread_state = thread->GetState();
110 LOG(ERROR) << "Unexpected thread state: " << internal_thread_state;
122 Thread* thread = Thread::FromManagedThread(soa, java_thread);
123 return thread->HoldsLock(object.Ptr());
129 Thread* thread = Thread::FromManagedThread(soa, java_thread);
130 if (thread != nullptr) {
131 thread->Interrupt(soa.Self());
144 // Suspend thread to avoid it from killing itself while we set its name. We don't just hold the
145 // thread list lock to avoid this, as setting the thread name causes mutator to lock/unlock
149 // Take suspend thread lock to avoid races with threads trying to suspend this one.
150 Thread* thread = thread_list->SuspendThreadByPeer(peer,
154 if (thread != nullptr) {
157 thread->SetThreadName(name.c_str());
159 bool resumed = thread_list->Resume(thread, SuspendReason::kInternal);
162 LOG(ERROR) << "Trying to set thread name to '" << name.c_str() << "' failed as the thread "
168 * Alter the priority of the specified thread. "new_priority" will range
169 * from Thread.MIN_PRIORITY to Thread.MAX_PRIORITY (1-10), with "normal"
170 * threads at Thread.NORM_PRIORITY (5).
175 Thread* thread = Thread::FromManagedThread(soa, java_thread);
176 if (thread != nullptr) {
177 thread->SetNativePriority(new_priority);
184 Monitor::Wait(Thread::Current(), lock.Ptr(), ms, ns, true, kSleeping);
188 * Causes the thread to temporarily pause and allow other threads to execute.
198 FAST_NATIVE_METHOD(Thread, currentThread, "()Ljava/lang/Thread;"),
199 FAST_NATIVE_METHOD(Thread, interrupted, "()Z"),
200 FAST_NATIVE_METHOD(Thread, isInterrupted, "()Z"),
201 NATIVE_METHOD(Thread, nativeCreate, "(Ljava/lang/Thread;JZ)V"),
202 NATIVE_METHOD(Thread, nativeGetStatus, "(Z)I"),
203 NATIVE_METHOD(Thread, nativeHoldsLock, "(Ljava/lang/Object;)Z"),
204 FAST_NATIVE_METHOD(Thread, nativeInterrupt, "()V"),
205 NATIVE_METHOD(Thread, nativeSetName, "(Ljava/lang/String;)V"),
206 NATIVE_METHOD(Thread, nativeSetPriority, "(I)V"),
207 FAST_NATIVE_METHOD(Thread, sleep, "(Ljava/lang/Object;JI)V"),
208 NATIVE_METHOD(Thread, yield, "()V"),
212 REGISTER_NATIVE_METHODS("java/lang/Thread");