#include <list.h>
#include <task.h>
#include <register.h>
#include <timer.h>
Go to the source code of this file.
Data Structures | |
struct | Thread |
Defines | |
#define | THREAD_QUANTUM_INITIAL (TIMER_HZ / 10) |
Typedefs | |
typedef unsigned int | ThreadQuantum |
typedef Thread | Thread |
Enumerations | |
enum | ThreadState { THREAD_STATE_UNSCHEDULED = 0, THREAD_STATE_READY, THREAD_STATE_RUNNING, THREAD_STATE_WAITING } |
Functions | |
int | thread_manager_initialize (void) |
Initialze thread manager. | |
Thread * | thread_current (void) |
Currently running thread. | |
Thread * | thread_create (Task *task) |
Create a new thread. | |
void | thread_destroy (Thread *) |
Destroy a thread. | |
Thread * | thread_fork (Task *task) |
Fork a new thread. | |
void | thread_exit (Thread *thread, int exitStatus) |
Exit from a thread. | |
Thread * | thread_find (int id) |
Find a thread by id. |
Provides the interface for managing threads.
|
Create a new thread. Create a new thread in a specified task.
|
|
Currently running thread. Return the currently running thread, if any.
|
|
Destroy a thread. Free the thread's memory resources and remove it from its task.
|
|
Exit from a thread. Exit from a thread, setting the exit status of the task and exiting from the host task if it is the last.
|
|
Find a thread by id. Find the thread associated with a given thread id.
|
|
Fork a new thread. Fork the current thread to run in a specified task.
|
|
Initialze thread manager. Initialize the thread manager's id tables.
|