1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 15:27:34 +00:00

Kernel: Turn Thread::current and Process::current into functions

This allows us to query the current thread and process on a
per processor basis
This commit is contained in:
Tom 2020-06-28 15:34:31 -06:00 committed by Andreas Kling
parent cdc78515b6
commit 16783bd14d
39 changed files with 518 additions and 369 deletions

View file

@ -32,10 +32,10 @@ namespace Kernel {
void FinalizerTask::spawn()
{
Process::create_kernel_process(g_finalizer, "FinalizerTask", [] {
Thread::current->set_priority(THREAD_PRIORITY_LOW);
Thread::current()->set_priority(THREAD_PRIORITY_LOW);
for (;;) {
dbg() << "Finalizer task is running";
Thread::current->wait_on(*g_finalizer_wait_queue);
Thread::current()->wait_on(*g_finalizer_wait_queue);
bool expected = true;
if (g_finalizer_has_work.compare_exchange_strong(expected, false, AK::MemoryOrder::memory_order_acq_rel))

View file

@ -38,7 +38,7 @@ void SyncTask::spawn()
dbg() << "SyncTask is running";
for (;;) {
VFS::the().sync();
Thread::current->sleep(1 * TimeManagement::the().ticks_per_second());
Thread::current()->sleep(1 * TimeManagement::the().ticks_per_second());
}
});
}