forked from OSchip/llvm-project
Fixing a problem where CommandObjectThreadContinue held the thread list lock while waiting for the process to stop after a continue.
llvm-svn: 190626
This commit is contained in:
parent
e5416ec2d2
commit
9063bf462a
|
@ -660,11 +660,14 @@ public:
|
||||||
StateType state = process->GetState();
|
StateType state = process->GetState();
|
||||||
if ((state == eStateCrashed) || (state == eStateStopped) || (state == eStateSuspended))
|
if ((state == eStateCrashed) || (state == eStateStopped) || (state == eStateSuspended))
|
||||||
{
|
{
|
||||||
Mutex::Locker locker (process->GetThreadList().GetMutex());
|
|
||||||
const uint32_t num_threads = process->GetThreadList().GetSize();
|
|
||||||
const size_t argc = command.GetArgumentCount();
|
const size_t argc = command.GetArgumentCount();
|
||||||
if (argc > 0)
|
if (argc > 0)
|
||||||
{
|
{
|
||||||
|
// These two lines appear at the beginning of both blocks in
|
||||||
|
// this if..else, but that is because we need to release the
|
||||||
|
// lock before calling process->Resume below.
|
||||||
|
Mutex::Locker locker (process->GetThreadList().GetMutex());
|
||||||
|
const uint32_t num_threads = process->GetThreadList().GetSize();
|
||||||
std::vector<Thread *> resume_threads;
|
std::vector<Thread *> resume_threads;
|
||||||
for (uint32_t i=0; i<argc; ++i)
|
for (uint32_t i=0; i<argc; ++i)
|
||||||
{
|
{
|
||||||
|
@ -732,6 +735,11 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// These two lines appear at the beginning of both blocks in
|
||||||
|
// this if..else, but that is because we need to release the
|
||||||
|
// lock before calling process->Resume below.
|
||||||
|
Mutex::Locker locker (process->GetThreadList().GetMutex());
|
||||||
|
const uint32_t num_threads = process->GetThreadList().GetSize();
|
||||||
Thread *current_thread = process->GetThreadList().GetSelectedThread().get();
|
Thread *current_thread = process->GetThreadList().GetSelectedThread().get();
|
||||||
if (current_thread == NULL)
|
if (current_thread == NULL)
|
||||||
{
|
{
|
||||||
|
@ -755,6 +763,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// We should not be holding the thread list lock when we do this.
|
||||||
Error error (process->Resume());
|
Error error (process->Resume());
|
||||||
if (error.Success())
|
if (error.Success())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue