#include <list.h>
#include <register.h>
Go to the source code of this file.
Data Structures | |
struct | Resource |
struct | Scheduler |
Functions | |
int | scheduler_initialize (void) |
Initialize the scheduler. | |
void | scheduler_tick (void) |
Tick the scheduler. | |
void | scheduler_context_switch (Registers *registers) |
Context switch to the next thread to run. | |
void | scheduler_jump (void) |
Jump into first ready thread. | |
void | scheduler_schedule (struct Thread *thread) |
Schedule a thread to be ready. | |
void | scheduler_unschedule (struct Thread *thread) |
Unschedule a ready or running thread. | |
void | scheduler_yield (struct Thread *thread) |
Yield to a thread. | |
int | resource_create (Resource *resource) |
Create a resource. | |
void | resource_destroy (Resource *resource) |
Destroy a resource. | |
void | resource_wait (Resource *resource, struct Thread *thread, void(*waitingHandler)(struct Thread *, void *), void *waitingData) |
Wait on a resource. | |
void | resource_rewait (Resource *resource, struct Thread *thread) |
Rewait on a resource. | |
int | resource_wake (Resource *resource, int amount) |
Signal threads waiting on resource. |
Provides the interface for scheduling threads and for scheduling resources.
|
Create a resource. Initialize the waiting thread list of the resource.
|
|
Destroy a resource. Free any memory associated with the resource.
|
|
Rewait on a resource. Inserts a thread at the front of the resource's wait queue, reusing any wake handlers the thread had previously specified the last time it waited.
|
|
Wait on a resource. Inserts a thread onto the back of a resource's wait queue, installing a wait handler to be invoked when the resource signals the thread to wake up.
|
|
Signal threads waiting on resource. Wake up a specified amount of threads waiting on the resource and invoke their wake handlers.
|
|
Context switch to the next thread to run. Context switches into the next thread that should be run, storing the interrupt registers as necessary.
|
|
Initialize the scheduler. Initiliazes the thread queues for the scheduler.
|
|
Jump into first ready thread. Moves into the first ready thread and activates scheduling.
|
|
Schedule a thread to be ready. Inserts a thread into the scheduler ready list.
|
|
Tick the scheduler. Implements the scheduler tick, which decrements the quantum of the currently running thread.
|
|
Unschedule a ready or running thread. Removes a thread from the ready list, or removes the currently running thread if that is the specified thread.
|
|
Yield to a thread. Pushes the currently running thread back onto the ready list and optionally moves the specified thread to the front of the ready list, so that it will be run upon return from interrupts.
|