mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
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.
This commit is contained in:
parent
6cb640eeba
commit
6a620562cc
Notes:
sideshowbarker
2024-07-19 01:08:54 +09:00
Author: https://github.com/tomuta
Commit: 6a620562cc
Pull-request: https://github.com/SerenityOS/serenity/pull/4113
11 changed files with 68 additions and 24 deletions
|
@ -215,6 +215,15 @@ void Thread::die_if_needed()
|
|||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
||||
void Thread::exit(void* exit_value)
|
||||
{
|
||||
ASSERT(Thread::current() == this);
|
||||
m_exit_value = exit_value;
|
||||
set_should_die();
|
||||
unlock_process_if_locked();
|
||||
die_if_needed();
|
||||
}
|
||||
|
||||
void Thread::yield_without_holding_big_lock()
|
||||
{
|
||||
bool did_unlock = unlock_process_if_locked();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue