2 * Copyright 2012-2016, Rene Gollent, rene@gollent.com.
3 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
4 * Distributed under the terms of the MIT License.
9 #include <AutoLocker.h>
12 #include "DebuggerInterface.h"
17 GetCpuStateJob::GetCpuStateJob(DebuggerInterface
* debuggerInterface
,
20 fKey(thread
, JOB_TYPE_GET_CPU_STATE
),
21 fDebuggerInterface(debuggerInterface
),
24 fThread
->AcquireReference();
28 GetCpuStateJob::~GetCpuStateJob()
30 fThread
->ReleaseReference();
35 GetCpuStateJob::Key() const
45 status_t error
= fDebuggerInterface
->GetCpuState(fThread
->ID(), state
);
48 BReference
<CpuState
> reference(state
, true);
50 AutoLocker
<Team
> locker(fThread
->GetTeam());
52 if (fThread
->State() == THREAD_STATE_STOPPED
)
53 fThread
->SetCpuState(state
);