Luna/kernel/src/thread/Thread.cpp

15 lines
241 B
C++
Raw Normal View History

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