@@ -528,12 +528,13 @@ bool ThreadList::WillResume() {
528
528
bool wants_solo_run = false ;
529
529
530
530
for (pos = m_threads.begin (); pos != end; ++pos) {
531
+ ThreadSP thread_sp (*pos);
531
532
lldbassert ((*pos)->GetCurrentPlan () &&
532
533
" thread should not have null thread plan" );
533
- if ((*pos) ->GetResumeState () != eStateSuspended &&
534
- (*pos) ->GetCurrentPlan ()->StopOthers ()) {
535
- if ((*pos) ->IsOperatingSystemPluginThread () &&
536
- !(*pos) ->GetBackingThread ())
534
+ if (thread_sp ->GetResumeState () != eStateSuspended &&
535
+ thread_sp ->GetCurrentPlan ()->StopOthers ()) {
536
+ if (thread_sp ->IsOperatingSystemPluginThread () &&
537
+ !thread_sp ->GetBackingThread ())
537
538
continue ;
538
539
wants_solo_run = true ;
539
540
break ;
@@ -546,12 +547,13 @@ bool ThreadList::WillResume() {
546
547
// others, only call setup on the threads that request StopOthers...
547
548
548
549
for (pos = m_threads.begin (); pos != end; ++pos) {
549
- if ((*pos)->GetResumeState () != eStateSuspended &&
550
+ ThreadSP thread_sp (*pos);
551
+ if (thread_sp->GetResumeState () != eStateSuspended &&
550
552
(!wants_solo_run || (*pos)->GetCurrentPlan ()->StopOthers ())) {
551
- if ((*pos) ->IsOperatingSystemPluginThread () &&
552
- !(*pos) ->GetBackingThread ())
553
+ if (thread_sp ->IsOperatingSystemPluginThread () &&
554
+ !thread_sp ->GetBackingThread ())
553
555
continue ;
554
- (*pos) ->SetupForResume ();
556
+ thread_sp ->SetupForResume ();
555
557
}
556
558
}
557
559
@@ -574,8 +576,8 @@ bool ThreadList::WillResume() {
574
576
ThreadSP thread_sp (*pos);
575
577
if (thread_sp->GetResumeState () != eStateSuspended &&
576
578
thread_sp->GetCurrentPlan ()->StopOthers ()) {
577
- if ((*pos) ->IsOperatingSystemPluginThread () &&
578
- !(*pos) ->GetBackingThread ())
579
+ if (thread_sp ->IsOperatingSystemPluginThread () &&
580
+ !thread_sp ->GetBackingThread ())
579
581
continue ;
580
582
581
583
// You can't say "stop others" and also want yourself to be suspended.
0 commit comments