blu_os
Loading...
Searching...
No Matches
thread.h
1#ifndef BLU_OS_THREAD_H
2#define BLU_OS_THREAD_H
3
4#include <stddef.h>
5#include <stdint.h>
6
7#define THREAD_RUNNABLE 1
8#define THREAD_EXITED 2
9
10typedef uint32_t tid_t;
11typedef int (*thread_entry_t)(void);
12typedef struct thread {
13 tid_t tid;
14 void* kernelStack;
15 size_t stackSize;
16 void* stackPointer;
17 thread_entry_t entryPoint;
18 uint8_t state;
19 struct thread* next;
20} Thread;
21
22extern void threadSwitch(Thread* from, Thread* to);
23
24Thread* createThread(thread_entry_t entry, size_t stackSize);
25
26#endif
Common definitions for C programs.
Fixed-width integer types.
Definition thread.h:12