mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:47:46 +00:00
Rename ProcessInspectionScope to ProcessInspectionHandle.
It might be useful to pass these things around.
This commit is contained in:
parent
2ac5e14c08
commit
a768c2b919
2 changed files with 16 additions and 10 deletions
|
@ -288,19 +288,25 @@ private:
|
|||
Region* m_signal_stack_kernel_region { nullptr };
|
||||
};
|
||||
|
||||
class ProcessInspectionScope {
|
||||
extern Process* current;
|
||||
|
||||
class ProcessInspectionHandle {
|
||||
public:
|
||||
ProcessInspectionScope(Process& process)
|
||||
ProcessInspectionHandle(Process& process)
|
||||
: m_process(process)
|
||||
, m_original_state(process.state())
|
||||
{
|
||||
m_process.set_state(Process::BeingInspected);
|
||||
if (&process != current)
|
||||
m_process.set_state(Process::BeingInspected);
|
||||
}
|
||||
|
||||
~ProcessInspectionScope()
|
||||
~ProcessInspectionHandle()
|
||||
{
|
||||
m_process.set_state(m_original_state);
|
||||
}
|
||||
|
||||
Process* operator->() { return &m_process; }
|
||||
Process& operator*() { return m_process; }
|
||||
private:
|
||||
Process& m_process;
|
||||
Process::State m_original_state { Process::Invalid };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue