summaryrefslogtreecommitdiff
path: root/Kernel/ThreadTracer.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-07 14:48:13 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-07 14:48:13 +0200
commitcd5d483bbd48e37203c2871dab7bb76884465b08 (patch)
treed2ac62f91ce0facf782e21c67f4a313b06dbc378 /Kernel/ThreadTracer.h
parentededd6aac65ee07449c5099957809533f7f6f584 (diff)
downloadserenity-cd5d483bbd48e37203c2871dab7bb76884465b08.zip
Kernel: Use KResultOr and TRY() for ThreadTracer
Also make the constructor private, since it's only called by the static factory function.
Diffstat (limited to 'Kernel/ThreadTracer.h')
-rw-r--r--Kernel/ThreadTracer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/ThreadTracer.h b/Kernel/ThreadTracer.h
index c7a66a1e90..beec018b5c 100644
--- a/Kernel/ThreadTracer.h
+++ b/Kernel/ThreadTracer.h
@@ -15,7 +15,7 @@ namespace Kernel {
class ThreadTracer {
public:
- static OwnPtr<ThreadTracer> create(ProcessID tracer) { return try_make<ThreadTracer>(tracer); }
+ static KResultOr<NonnullOwnPtr<ThreadTracer>> try_create(ProcessID tracer) { return adopt_nonnull_own_or_enomem(new (nothrow) ThreadTracer(tracer)); }
ProcessID tracer_pid() const { return m_tracer_pid; }
bool has_pending_signal(u32 signal) const { return m_pending_signals & (1 << (signal - 1)); }
@@ -34,9 +34,9 @@ public:
return m_regs.value();
}
+private:
explicit ThreadTracer(ProcessID);
-private:
ProcessID m_tracer_pid { -1 };
// This is a bitmap for signals that are sent from the tracer to the tracee