15 lines
241 B
C++
15 lines
241 B
C++
|
#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;
|
||
|
}
|