Lines Matching refs:self

69 ScopedNoUserCodeSuspension::ScopedNoUserCodeSuspension(art::Thread* self) : self_(self) {  in ScopedNoUserCodeSuspension()  argument
70 DCHECK_EQ(self, art::Thread::Current()); in ScopedNoUserCodeSuspension()
94 jthread GetThreadObject(art::Thread* self) REQUIRES_SHARED(art::Locks::mutator_lock_) { in GetThreadObject()
95 if (self->GetPeer() == nullptr) { in GetThreadObject()
98 return self->GetJniEnv()->AddLocalReference<jthread>(self->GetPeer()); in GetThreadObject()
102 void Post(art::Thread* self) REQUIRES_SHARED(art::Locks::mutator_lock_) { in Post()
103 DCHECK_EQ(self, art::Thread::Current()); in Post()
104 ScopedLocalRef<jthread> thread(self->GetJniEnv(), GetThreadObject(self)); in Post()
105 art::ScopedThreadSuspension sts(self, art::ThreadState::kNative); in Post()
106 event_handler->DispatchEvent<kEvent>(self, in Post()
107 reinterpret_cast<JNIEnv*>(self->GetJniEnv()), in Post()
111 void ThreadStart(art::Thread* self) override REQUIRES_SHARED(art::Locks::mutator_lock_) { in ThreadStart()
114 if (self->IsSystemDaemon()) { in ThreadStart()
129 self->GetThreadName(name); in ThreadStart()
136 << self->GetThreadId(); in ThreadStart()
141 Post<ArtJvmtiEvent::kThreadStart>(self); in ThreadStart()
144 void ThreadDeath(art::Thread* self) override REQUIRES_SHARED(art::Locks::mutator_lock_) { in ThreadDeath()
145 Post<ArtJvmtiEvent::kThreadEnd>(self); in ThreadDeath()
175 static void WaitForSystemDaemonStart(art::Thread* self) REQUIRES_SHARED(art::Locks::mutator_lock_) { in WaitForSystemDaemonStart() argument
177 art::ScopedThreadStateChange strc(self, art::kNative); in WaitForSystemDaemonStart()
178 JNIEnv* jni = self->GetJniEnv(); in WaitForSystemDaemonStart()
182 if (self->IsExceptionPending()) { in WaitForSystemDaemonStart()
184 << self->GetException()->Dump(); in WaitForSystemDaemonStart()
185 self->ClearException(); in WaitForSystemDaemonStart()
192 art::Thread* self = art::Thread::Current(); in CacheData() local
193 art::ScopedObjectAccess soa(self); in CacheData()
202 WaitForSystemDaemonStart(self); in CacheData()
214 art::Thread* self = art::Thread::Current(); in GetCurrentThread() local
216 art::ScopedObjectAccess soa(self); in GetCurrentThread()
219 if (self->IsStillStarting()) { in GetCurrentThread()
222 thread_peer = soa.AddLocalReference<jthread>(self->GetPeer()); in GetCurrentThread()
269 art::Thread* self = art::Thread::Current(); in GetThreadInfo() local
270 art::ScopedObjectAccess soa(self); in GetThreadInfo()
271 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in GetThreadInfo()
548 void ThreadUtil::SuspendCheck(art::Thread* self) { in SuspendCheck() argument
549 art::ScopedObjectAccess soa(self); in SuspendCheck()
551 self->FullSuspendCheck(); in SuspendCheck()
554 bool ThreadUtil::WouldSuspendForUserCodeLocked(art::Thread* self) { in WouldSuspendForUserCodeLocked() argument
555 DCHECK(self == art::Thread::Current()); in WouldSuspendForUserCodeLocked()
556 art::MutexLock tscl_mu(self, *art::Locks::thread_suspend_count_lock_); in WouldSuspendForUserCodeLocked()
557 return self->GetUserCodeSuspendCount() != 0; in WouldSuspendForUserCodeLocked()
560 bool ThreadUtil::WouldSuspendForUserCode(art::Thread* self) { in WouldSuspendForUserCode() argument
561 DCHECK(self == art::Thread::Current()); in WouldSuspendForUserCode()
562 art::MutexLock ucsl_mu(self, *art::Locks::user_code_suspension_lock_); in WouldSuspendForUserCode()
563 return WouldSuspendForUserCodeLocked(self); in WouldSuspendForUserCode()
573 art::Thread* self = art::Thread::Current(); in GetThreadState() local
576 ScopedNoUserCodeSuspension snucs(self); in GetThreadState()
577 art::ScopedObjectAccess soa(self); in GetThreadState()
578 art::MutexLock tll_mu(self, *art::Locks::thread_list_lock_); in GetThreadState()
610 art::ScopedObjectAccess soa(self); in GetThreadState()
611 art::StackHandleScope<1> hs(self); in GetThreadState()
688 art::Thread* self = art::Thread::Current(); in RemoveEnvironment() local
689 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in RemoveEnvironment()
695 art::Thread* self = art::Thread::Current(); in SetThreadLocalStorage() local
696 art::ScopedObjectAccess soa(self); in SetThreadLocalStorage()
697 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in SetThreadLocalStorage()
732 art::Thread* self = art::Thread::Current(); in GetThreadLocalStorage() local
733 art::ScopedObjectAccess soa(self); in GetThreadLocalStorage()
734 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in GetThreadLocalStorage()
771 art::Thread* self = art::Thread::Attach(data->name.c_str(), true, data->thread); in AgentCallback() local
772 CHECK(self != nullptr) << "threads_being_born_ should have ensured thread could be attached."; in AgentCallback()
776 art::ScopedObjectAccess soa(self); in AgentCallback()
777 self->SetThreadName(data->name.c_str()); in AgentCallback()
781 JNIEnv* env = self->GetJniEnv(); in AgentCallback()
872 jvmtiError ThreadUtil::SuspendOther(art::Thread* self, in SuspendOther() argument
878 ScopedNoUserCodeSuspension snucs(self); in SuspendOther()
881 art::ScopedObjectAccess soa(self); in SuspendOther()
882 art::MutexLock thread_list_mu(self, *art::Locks::thread_list_lock_); in SuspendOther()
892 art::MutexLock thread_suspend_count_mu(self, *art::Locks::thread_suspend_count_lock_); in SuspendOther()
917 jvmtiError ThreadUtil::SuspendSelf(art::Thread* self) { in SuspendSelf() argument
918 CHECK(self == art::Thread::Current()); in SuspendSelf()
920 art::MutexLock mu(self, *art::Locks::user_code_suspension_lock_); in SuspendSelf()
921 art::MutexLock thread_list_mu(self, *art::Locks::thread_suspend_count_lock_); in SuspendSelf()
922 if (self->GetUserCodeSuspendCount() != 0) { in SuspendSelf()
927 if (!self->ModifySuspendCount(self, +1, nullptr, art::SuspendReason::kForUserCode)) { in SuspendSelf()
935 SuspendCheck(self); in SuspendSelf()
940 art::Thread* self = art::Thread::Current(); in SuspendThread() local
943 art::ScopedObjectAccess soa(self); in SuspendThread()
944 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in SuspendThread()
949 } else if (target == self) { in SuspendThread()
954 return SuspendSelf(self); in SuspendThread()
956 return SuspendOther(self, thread); in SuspendThread()
965 art::Thread* self = art::Thread::Current(); in ResumeThread() local
969 ScopedNoUserCodeSuspension snucs(self); in ResumeThread()
974 art::ScopedObjectAccess soa(self); in ResumeThread()
975 art::MutexLock tll_mu(self, *art::Locks::thread_list_lock_); in ResumeThread()
979 } else if (target == self) { in ResumeThread()
988 art::MutexLock thread_suspend_count_mu(self, *art::Locks::thread_suspend_count_lock_); in ResumeThread()
996 DCHECK(target != self); in ResumeThread()
1011 art::Thread* self = art::Thread::Current(); in IsCurrentThread() local
1012 art::ScopedObjectAccess soa(self); in IsCurrentThread()
1013 art::MutexLock mu(self, *art::Locks::thread_list_lock_); in IsCurrentThread()
1017 return target == self; in IsCurrentThread()
1081 art::Thread* self = art::Thread::Current(); in StopThread() local
1082 art::ScopedObjectAccess soa(self); in StopThread()
1083 art::StackHandleScope<1> hs(self); in StopThread()
1092 art::Locks::thread_list_lock_->ExclusiveLock(self); in StopThread()
1096 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in StopThread()
1099 art::Locks::thread_list_lock_->ExclusiveUnlock(self); in StopThread()
1128 art::Thread* self = art::Thread::Current(); in InterruptThread() local
1129 art::ScopedObjectAccess soa(self); in InterruptThread()
1130 art::MutexLock tll_mu(self, *art::Locks::thread_list_lock_); in InterruptThread()
1138 target->Interrupt(self); in InterruptThread()