forked from OSchip/llvm-project
Fixed an issue with MachTask::TaskResume () where if the task was already
suspended, we would call "int ::task_resume (task_t task);" as many times as it took to resume the task which isn't what we want to do. llvm-svn: 116674
This commit is contained in:
parent
cd86570b93
commit
556658c79e
|
@ -86,14 +86,18 @@ MachTask::Resume()
|
|||
{
|
||||
struct task_basic_info task_info;
|
||||
task_t task = TaskPort();
|
||||
if (task == TASK_NULL)
|
||||
return KERN_INVALID_ARGUMENT;
|
||||
|
||||
DNBError err;
|
||||
err = BasicInfo(task, &task_info);
|
||||
|
||||
if (err.Success())
|
||||
{
|
||||
integer_t i;
|
||||
for (i=0; i<task_info.suspend_count; i++)
|
||||
// task_resume isn't counted like task_suspend calls are, are, so if the
|
||||
// task is not suspended, don't try and resume it since it is already
|
||||
// running
|
||||
if (task_info.suspend_count > 0)
|
||||
{
|
||||
err = ::task_resume (task);
|
||||
if (DNBLogCheckLogBit(LOG_TASK) || err.Fail())
|
||||
|
|
Loading…
Reference in New Issue