diff options
author | Tom <tomut@yahoo.com> | 2020-11-16 20:51:34 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-11-30 13:17:02 +0100 |
commit | 6a620562cc7298c2f591a06817ff560c9ef1deac (patch) | |
tree | f163becbd40b4b4cf7058ca2ea191dec7335f1ed /Kernel/Tasks/FinalizerTask.cpp | |
parent | 6cb640eebaf40acbd505bcfdb0dee8e99fb77223 (diff) | |
download | serenity-6a620562cc7298c2f591a06817ff560c9ef1deac.zip |
Kernel: Allow passing a thread argument for new kernel threads
This adds the ability to pass a pointer to kernel thread/process.
Also add the ability to use a closure as thread function, which
allows passing information to a kernel thread more easily.
Diffstat (limited to 'Kernel/Tasks/FinalizerTask.cpp')
-rw-r--r-- | Kernel/Tasks/FinalizerTask.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Tasks/FinalizerTask.cpp b/Kernel/Tasks/FinalizerTask.cpp index fe82f84ab9..f05d573a7f 100644 --- a/Kernel/Tasks/FinalizerTask.cpp +++ b/Kernel/Tasks/FinalizerTask.cpp @@ -32,7 +32,7 @@ namespace Kernel { void FinalizerTask::spawn() { RefPtr<Thread> finalizer_thread; - Process::create_kernel_process(finalizer_thread, "FinalizerTask", [] { + Process::create_kernel_process(finalizer_thread, "FinalizerTask", [](void*) { Thread::current()->set_priority(THREAD_PRIORITY_LOW); for (;;) { Thread::current()->wait_on(*g_finalizer_wait_queue, "FinalizerTask"); @@ -41,7 +41,7 @@ void FinalizerTask::spawn() if (g_finalizer_has_work.compare_exchange_strong(expected, false, AK::MemoryOrder::memory_order_acq_rel)) Thread::finalize_dying_threads(); } - }); + }, nullptr); g_finalizer = finalizer_thread; } |