• Home
  • Raw
  • Download

Lines Matching refs:self

100   Thread* self = Thread::Current();  in ShutDown()  local
102 MutexLock mu(self, *Locks::thread_list_lock_); in ShutDown()
103 contains = Contains(self); in ShutDown()
171 Thread* self = Thread::Current(); in DumpUnattachedThreads() local
179 MutexLock mu(self, *Locks::thread_list_lock_); in DumpUnattachedThreads()
210 Thread* self = Thread::Current(); in Run() local
211 CHECK(self != nullptr); in Run()
215 ScopedObjectAccess soa(self); in Run()
219 MutexLock mu(self, lock_); in Run()
224 barrier_.Pass(self); in Run()
228 void Dump(Thread* self, std::ostream& os) { in Dump() argument
229 MutexLock mu(self, lock_); in Dump()
236 Thread* self = Thread::Current(); in WaitForThreadsToRunThroughCheckpoint() local
237 ScopedThreadStateChange tsc(self, ThreadState::kWaitingForCheckPointsToRun); in WaitForThreadsToRunThroughCheckpoint()
238 bool timed_out = barrier_.Increment(self, threads_running_checkpoint, kDumpWaitTimeout); in WaitForThreadsToRunThroughCheckpoint()
260 Thread* self = Thread::Current(); in Dump() local
262 MutexLock mu(self, *Locks::thread_list_lock_); in Dump()
265 if (self != nullptr) { in Dump()
270 ScopedObjectAccess soa(self); in Dump()
276 checkpoint.Dump(self, os); in Dump()
282 void ThreadList::AssertThreadsAreSuspended(Thread* self, Thread* ignore1, Thread* ignore2) { in AssertThreadsAreSuspended() argument
283 MutexLock mu(self, *Locks::thread_list_lock_); in AssertThreadsAreSuspended()
284 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in AssertThreadsAreSuspended()
327 Thread* self = Thread::Current(); in RunCheckpoint() local
328 Locks::mutator_lock_->AssertNotExclusiveHeld(self); in RunCheckpoint()
329 Locks::thread_list_lock_->AssertNotHeld(self); in RunCheckpoint()
330 Locks::thread_suspend_count_lock_->AssertNotHeld(self); in RunCheckpoint()
337 MutexLock mu(self, *Locks::thread_list_lock_); in RunCheckpoint()
338 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RunCheckpoint()
341 if (thread != self) { in RunCheckpoint()
349 thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in RunCheckpoint()
362 thread->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal); in RunCheckpoint()
384 callback->Run(self); in RunCheckpoint()
389 checkpoint_function->Run(self); in RunCheckpoint()
397 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RunCheckpoint()
398 bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in RunCheckpoint()
406 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RunCheckpoint()
407 Thread::resume_cond_->Broadcast(self); in RunCheckpoint()
414 Thread* self = Thread::Current(); in RunEmptyCheckpoint() local
415 Locks::mutator_lock_->AssertNotExclusiveHeld(self); in RunEmptyCheckpoint()
416 Locks::thread_list_lock_->AssertNotHeld(self); in RunEmptyCheckpoint()
417 Locks::thread_suspend_count_lock_->AssertNotHeld(self); in RunEmptyCheckpoint()
421 barrier->Init(self, 0); in RunEmptyCheckpoint()
423 MutexLock mu(self, *Locks::thread_list_lock_); in RunEmptyCheckpoint()
424 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in RunEmptyCheckpoint()
426 if (thread != self) { in RunEmptyCheckpoint()
449 Runtime::Current()->GetHeap()->GetReferenceProcessor()->BroadcastForSlowPath(self); in RunEmptyCheckpoint()
452 ScopedThreadStateChange tsc(self, ThreadState::kWaitingForCheckPointsToRun); in RunEmptyCheckpoint()
470 bool timed_out = barrier->Increment(self, barrier_count, kEmptyCheckpointPeriodicTimeoutMs); in RunEmptyCheckpoint()
479 ss << "Barrier count " << barrier->GetCount(self) << "\n"; in RunEmptyCheckpoint()
491 ScopedObjectAccess soa(self); in RunEmptyCheckpoint()
492 MutexLock mu1(self, *Locks::thread_list_lock_); in RunEmptyCheckpoint()
527 Thread* self = Thread::Current(); in FlipThreadRoots() local
528 Locks::mutator_lock_->AssertNotHeld(self); in FlipThreadRoots()
529 Locks::thread_list_lock_->AssertNotHeld(self); in FlipThreadRoots()
530 Locks::thread_suspend_count_lock_->AssertNotHeld(self); in FlipThreadRoots()
531 CHECK_NE(self->GetState(), ThreadState::kRunnable); in FlipThreadRoots()
535 collector->GetHeap()->ThreadFlipBegin(self); // Sync with JNI critical calls. in FlipThreadRoots()
540 SuspendAllInternal(self, self, nullptr); in FlipThreadRoots()
546 Locks::mutator_lock_->ExclusiveLock(self); in FlipThreadRoots()
548 flip_callback->Run(self); in FlipThreadRoots()
565 MutexLock mu(self, *Locks::thread_list_lock_); in FlipThreadRoots()
566 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in FlipThreadRoots()
572 if (thread == self) { in FlipThreadRoots()
583 bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in FlipThreadRoots()
590 Thread::resume_cond_->Broadcast(self); in FlipThreadRoots()
597 collector->GetHeap()->ThreadFlipEnd(self); in FlipThreadRoots()
603 thread->EnsureFlipFunctionStarted(self); in FlipThreadRoots()
607 self->EnsureFlipFunctionStarted(self); in FlipThreadRoots()
608 DCHECK(!self->ReadFlag(ThreadFlag::kPendingFlipFunction)); in FlipThreadRoots()
611 Locks::mutator_lock_->ExclusiveUnlock(self); in FlipThreadRoots()
616 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in FlipThreadRoots()
618 bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in FlipThreadRoots()
621 Thread::resume_cond_->Broadcast(self); in FlipThreadRoots()
628 Thread* self = Thread::Current(); in SuspendAll() local
630 if (self != nullptr) { in SuspendAll()
631 VLOG(threads) << *self << " SuspendAll for " << cause << " starting..."; in SuspendAll()
639 SuspendAllInternal(self, self); in SuspendAll()
644 if (Locks::mutator_lock_->ExclusiveLockWithTimeout(self, in SuspendAll()
656 Locks::mutator_lock_->ExclusiveLock(self); in SuspendAll()
670 AssertThreadsAreSuspended(self, self); in SuspendAll()
675 if (self != nullptr) { in SuspendAll()
676 VLOG(threads) << *self << " SuspendAll complete"; in SuspendAll()
683 void ThreadList::SuspendAllInternal(Thread* self, in SuspendAllInternal() argument
687 Locks::mutator_lock_->AssertNotExclusiveHeld(self); in SuspendAllInternal()
688 Locks::thread_list_lock_->AssertNotHeld(self); in SuspendAllInternal()
689 Locks::thread_suspend_count_lock_->AssertNotHeld(self); in SuspendAllInternal()
690 if (kDebugLocking && self != nullptr) { in SuspendAllInternal()
691 CHECK_NE(self->GetState(), ThreadState::kRunnable); in SuspendAllInternal()
712 MutexLock mu(self, *Locks::thread_list_lock_); in SuspendAllInternal()
713 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in SuspendAllInternal()
723 bool updated = thread->ModifySuspendCount(self, +1, &pending_threads, reason); in SuspendAllInternal()
756 MutexLock mu(self, *Locks::thread_list_lock_); in SuspendAllInternal()
757 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in SuspendAllInternal()
787 Thread* self = Thread::Current(); in ResumeAll() local
789 if (self != nullptr) { in ResumeAll()
790 VLOG(threads) << *self << " ResumeAll starting"; in ResumeAll()
801 AssertThreadsAreSuspended(self, self); in ResumeAll()
806 Locks::mutator_lock_->ExclusiveUnlock(self); in ResumeAll()
808 MutexLock mu(self, *Locks::thread_list_lock_); in ResumeAll()
809 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in ResumeAll()
814 if (thread == self) { in ResumeAll()
817 bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in ResumeAll()
823 if (self != nullptr) { in ResumeAll()
824 VLOG(threads) << *self << " ResumeAll waking others"; in ResumeAll()
828 Thread::resume_cond_->Broadcast(self); in ResumeAll()
831 if (self != nullptr) { in ResumeAll()
832 VLOG(threads) << *self << " ResumeAll complete"; in ResumeAll()
842 Thread* self = Thread::Current(); in Resume() local
843 DCHECK_NE(thread, self); in Resume()
848 MutexLock mu(self, *Locks::thread_list_lock_); in Resume()
850 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in Resume()
863 if (UNLIKELY(!thread->ModifySuspendCount(self, -1, nullptr, reason))) { in Resume()
872 MutexLock mu(self, *Locks::thread_suspend_count_lock_); in Resume()
873 Thread::resume_cond_->Broadcast(self); in Resume()
901 Thread* const self = Thread::Current(); in SuspendThreadByPeer() local
912 ScopedObjectAccess soa(self); in SuspendThreadByPeer()
913 MutexLock thread_list_mu(self, *Locks::thread_list_lock_); in SuspendThreadByPeer()
917 MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_); in SuspendThreadByPeer()
941 MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_); in SuspendThreadByPeer()
943 if (self->GetSuspendCount() > 0) { in SuspendThreadByPeer()
952 bool updated = suspended_thread->ModifySuspendCount(self, +1, nullptr, reason); in SuspendThreadByPeer()
963 CHECK_NE(thread, self) << "Attempt to suspend the current thread for the debugger"; in SuspendThreadByPeer()
991 Locks::thread_suspend_count_lock_->Unlock(self); in SuspendThreadByPeer()
1028 Thread* const self = Thread::Current(); in SuspendThreadByThreadId() local
1038 ScopedObjectAccess soa(self); in SuspendThreadByThreadId()
1039 MutexLock thread_list_mu(self, *Locks::thread_list_lock_); in SuspendThreadByThreadId()
1059 MutexLock suspend_count_mu(self, *Locks::thread_suspend_count_lock_); in SuspendThreadByThreadId()
1061 if (self->GetSuspendCount() > 0) { in SuspendThreadByThreadId()
1067 bool updated = thread->ModifySuspendCount(self, +1, nullptr, reason); in SuspendThreadByThreadId()
1079 CHECK_NE(thread, self) << "Attempt to suspend the current thread for the debugger"; in SuspendThreadByThreadId()
1139 Thread* self = Thread::Current(); in WaitForOtherNonDaemonThreadsToExit() local
1140 Locks::mutator_lock_->AssertNotHeld(self); in WaitForOtherNonDaemonThreadsToExit()
1142 Locks::runtime_shutdown_lock_->Lock(self); in WaitForOtherNonDaemonThreadsToExit()
1151 Locks::runtime_shutdown_lock_->Unlock(self); in WaitForOtherNonDaemonThreadsToExit()
1156 MutexLock mu(self, *Locks::thread_list_lock_); in WaitForOtherNonDaemonThreadsToExit()
1157 Locks::runtime_shutdown_lock_->Unlock(self); in WaitForOtherNonDaemonThreadsToExit()
1164 if (thread != self && !thread->IsDaemon()) { in WaitForOtherNonDaemonThreadsToExit()
1174 Locks::thread_exit_cond_->Wait(self); in WaitForOtherNonDaemonThreadsToExit()
1180 Thread* self = Thread::Current(); in SuspendAllDaemonThreadsForShutdown() local
1184 MutexLock mu(self, *Locks::thread_list_lock_); in SuspendAllDaemonThreadsForShutdown()
1185 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in SuspendAllDaemonThreadsForShutdown()
1190 if (thread != self) { in SuspendAllDaemonThreadsForShutdown()
1191 bool updated = thread->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal); in SuspendAllDaemonThreadsForShutdown()
1222 MutexLock mu(self, *Locks::thread_list_lock_); in SuspendAllDaemonThreadsForShutdown()
1224 if (thread != self && thread->GetState() == ThreadState::kRunnable) { in SuspendAllDaemonThreadsForShutdown()
1253 MutexLock mu(self, *Locks::thread_list_lock_); in SuspendAllDaemonThreadsForShutdown()
1259 DCHECK(thread == self || !all_suspended || thread->GetState() != ThreadState::kRunnable); in SuspendAllDaemonThreadsForShutdown()
1278 void ThreadList::Register(Thread* self) { in Register() argument
1279 DCHECK_EQ(self, Thread::Current()); in Register()
1284 self->ShortDump(oss); // We don't hold the mutator_lock_ yet and so cannot call Dump. in Register()
1285 LOG(INFO) << "ThreadList::Register() " << *self << "\n" << oss.str(); in Register()
1290 MutexLock mu(self, *Locks::thread_list_lock_); in Register()
1291 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in Register()
1295 bool updated = self->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal); in Register()
1298 CHECK(!Contains(self)); in Register()
1299 list_.push_back(self); in Register()
1304 self->SetIsGcMarkingAndUpdateEntrypoints(cc->IsMarking()); in Register()
1306 self->SetReadBarrierEntrypoints(); in Register()
1308 self->SetWeakRefAccessEnabled(cc->IsWeakRefAccessEnabled()); in Register()
1312 void ThreadList::Unregister(Thread* self, bool should_run_callbacks) { in Unregister() argument
1313 DCHECK_EQ(self, Thread::Current()); in Unregister()
1314 CHECK_NE(self->GetState(), ThreadState::kRunnable); in Unregister()
1315 Locks::mutator_lock_->AssertNotHeld(self); in Unregister()
1316 if (self->tls32_.disable_thread_flip_count != 0) { in Unregister()
1317 LOG(FATAL) << "Incomplete PrimitiveArrayCritical section at exit: " << *self << "count = " in Unregister()
1318 << self->tls32_.disable_thread_flip_count; in Unregister()
1321 VLOG(threads) << "ThreadList::Unregister() " << *self; in Unregister()
1324 MutexLock mu(self, *Locks::thread_list_lock_); in Unregister()
1333 self->Destroy(should_run_callbacks); in Unregister()
1336 Trace::StoreExitingThreadInfo(self); in Unregister()
1338 uint32_t thin_lock_id = self->GetThreadId(); in Unregister()
1344 MutexLock mu(self, *Locks::thread_list_lock_); in Unregister()
1345 if (!Contains(self)) { in Unregister()
1347 self->GetThreadName(thread_name); in Unregister()
1353 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in Unregister()
1354 if (!self->IsSuspended()) { in Unregister()
1355 list_.remove(self); in Unregister()
1365 delete self; in Unregister()
1394 Thread* const self = Thread::Current(); in VisitRootsForSuspendedThreads() local
1399 MutexLock mu(self, *Locks::thread_list_lock_); in VisitRootsForSuspendedThreads()
1400 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in VisitRootsForSuspendedThreads()
1402 bool suspended = thread->ModifySuspendCount(self, +1, nullptr, SuspendReason::kInternal); in VisitRootsForSuspendedThreads()
1404 if (thread == self || thread->IsSuspended()) { in VisitRootsForSuspendedThreads()
1407 bool resumed = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in VisitRootsForSuspendedThreads()
1421 MutexLock mu2(self, *Locks::thread_suspend_count_lock_); in VisitRootsForSuspendedThreads()
1423 bool updated = thread->ModifySuspendCount(self, -1, nullptr, SuspendReason::kInternal); in VisitRootsForSuspendedThreads()
1450 uint32_t ThreadList::AllocThreadId(Thread* self) { in AllocThreadId() argument
1451 MutexLock mu(self, *Locks::allocated_thread_ids_lock_); in AllocThreadId()
1462 void ThreadList::ReleaseThreadId(Thread* self, uint32_t id) { in ReleaseThreadId() argument
1463 MutexLock mu(self, *Locks::allocated_thread_ids_lock_); in ReleaseThreadId()