1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 17:15:08 +00:00

Kernel: Make Thread refcounted

Similar to Process, we need to make Thread refcounted. This will solve
problems that will appear once we schedule threads on more than one
processor. This allows us to hold onto threads without necessarily
holding the scheduler lock for the entire duration.
This commit is contained in:
Tom 2020-09-27 08:53:35 -06:00 committed by Andreas Kling
parent 079486ed7e
commit 838d9fa251
14 changed files with 136 additions and 90 deletions

View file

@ -33,7 +33,7 @@ namespace Kernel {
void SyncTask::spawn()
{
Thread* syncd_thread = nullptr;
RefPtr<Thread> syncd_thread;
Process::create_kernel_process(syncd_thread, "SyncTask", [] {
dbg() << "SyncTask is running";
for (;;) {