Implementation of threads.
◆ threadCreate()
Creates a new kernel thread object.
This function allocates and initializes the structure used to store a thread. If original is NULL then all task registers will be initialized to their default values, otherwise they will be duplicated from the original thread. When duplicating an existing thread all the additional arguments like the entry point are ignored.
- Parameters
-
p | Pointer to the kernel process object which should contain the new thread |
original | Pointer to the original thread object or NULL |
eip | Entrypoint (EIP register) of the newly created process |
- Returns
- Pointer to the thread kernel object
Definition at line 80 of file thread.c.
◆ threadSchedule()
Schedules threads until all process have been terminated.
This is the main function which is responsible for running usermode code. It will be blocking until all processes have been terminated.
Definition at line 355 of file thread.c.
◆ threadWait()
uint32_t threadWait |
( |
struct thread * |
t, |
|
|
struct object * |
obj, |
|
|
uint32_t |
mode |
|
) |
| |
Makes a kernel thread object wait for some waitable object.
This function first checks if the wait object will be blocking, or if the operation continues immediately. If it is blocking it will unlink the thread from the list of runnable threads, and append it to the wait queue for the corresponding wait object.
- Parameters
-
t | Pointer to the kernel thread object |
obj | Wait object |
mode | Mode of the wait operation |
- Returns
- INTERRUPT_CONTINUE_EXECUTION if the operation was non-blocking, otherwise INTERRUPT_YIELD
Definition at line 388 of file thread.c.
◆ lastFPUthread
◆ threadList