summaryrefslogtreecommitdiff
path: root/Kernel/Process.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-11-14 21:04:34 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-11-14 21:04:34 +0100
commitcb5021419ea71d204effb65f604978c017dd813f (patch)
tree88e344bf1dc4cbbaab6450eabe445cdb89c8286e /Kernel/Process.cpp
parent69efa3f630141a74ced338b07d8466a5a0e7557f (diff)
downloadserenity-cb5021419ea71d204effb65f604978c017dd813f.zip
Kernel: Move Thread::m_joinee_exit_value into the JoinBlocker
There's no need for this to be a permanent Thread member. Just use a reference in the JoinBlocker instead.
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r--Kernel/Process.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp
index d1f3ab495b..f37ffdd080 100644
--- a/Kernel/Process.cpp
+++ b/Kernel/Process.cpp
@@ -2906,15 +2906,17 @@ int Process::sys$join_thread(int tid, void** exit_value)
// FIXME: EINVAL: 'thread' is not a joinable thread
+ void* joinee_exit_value = nullptr;
+
// FIXME: pthread_join() should not be interruptable. Enforce this somehow?
- auto result = current->block<Thread::JoinBlocker>(*thread);
+ auto result = current->block<Thread::JoinBlocker>(*thread, joinee_exit_value);
(void)result;
// NOTE: 'thread' is very possibly deleted at this point. Clear it just to be safe.
thread = nullptr;
if (exit_value)
- *exit_value = current->m_joinee_exit_value;
+ *exit_value = joinee_exit_value;
return 0;
}