Luna/kernel/src/thread/Thread.cpp
apio a11a5dec1f
All checks were successful
continuous-integration/drone/push Build is passing
DoublyLinkedList -> LinkedList
2022-12-19 12:43:23 +01:00

21 lines
308 B
C++

#include "thread/Thread.h"
#include <luna/Alloc.h>
#include <luna/Atomic.h>
static Atomic<u64> g_next_id;
LinkedList<Thread> g_threads;
void Thread::init()
{
g_next_id = 1;
}
Result<Thread*> new_thread()
{
Thread* thread = TRY(make<Thread>());
thread->id = g_next_id++;
return thread;
}