Skip to content

Commit 398c504

Browse files
committed
[lldb] Replace check of run_me_only_list.GetSize() with test of thread_to_run against null
This is clearer and it means we don't have to update `run_me_only_list` when `SetupForResume()` returns true, which was confusing.
1 parent f1daf01 commit 398c504

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/source/Target/ThreadList.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ bool ThreadList::WillResume() {
588588
if (thread_sp->SetupForResume()) {
589589
// You can't say "stop others" and also want yourself to be suspended.
590590
assert(thread_sp->GetCurrentPlan()->RunState() != eStateSuspended);
591-
run_me_only_list.AddThread(thread_sp);
592591
thread_to_run = thread_sp;
593592
if (thread_sp->ShouldRunBeforePublicStop()) {
594593
// This takes precedence, so if we find one of these, service it:
@@ -599,7 +598,7 @@ bool ThreadList::WillResume() {
599598
}
600599
}
601600

602-
if (run_me_only_list.GetSize(false) > 0) {
601+
if (thread_to_run != nullptr) {
603602
Log *log = GetLog(LLDBLog::Step);
604603
if (log && log->GetVerbose())
605604
LLDB_LOGF(log, "Turning on notification of new threads while single "
@@ -615,7 +614,7 @@ bool ThreadList::WillResume() {
615614

616615
bool need_to_resume = true;
617616

618-
if (run_me_only_list.GetSize(false) == 0) {
617+
if (thread_to_run == nullptr) {
619618
// Everybody runs as they wish:
620619
for (pos = m_threads.begin(); pos != end; ++pos) {
621620
ThreadSP thread_sp(*pos);

0 commit comments

Comments
 (0)