-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheduler.h
38 lines (30 loc) · 1.1 KB
/
scheduler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//****************************************************************************
// CS 502 Operating System Project.
// Che Sun at Worcester Polytechnic Institute, Fall 2014.
//****************************************************************************
#ifndef SCHEDULER_H_
#define SCHEDULER_H_
#include "pcb.h"
// Scheduler function pointers.
typedef void (*SchedulerOnRedispatch)();
typedef void (*SchedulerOnProcessTerminate)();
typedef void (*SchedulerOnProcessSleep)();
typedef void (*SchedulerOnProcessSuspend)();
typedef void (*SchedulerOnProcessWait)();
typedef void (*SchedulerDispatch)();
typedef struct Scheduler
{
SchedulerOnRedispatch OnRedispatch;
SchedulerOnProcessTerminate OnProcessTerminate;
SchedulerOnProcessSleep OnProcessSleep;
SchedulerOnProcessSuspend OnProcessSuspend;
SchedulerOnProcessWait OnProcessWait;
SchedulerDispatch Dispatch;
PCB* schedulerPCB;
} Scheduler;
// Create scheduler when the OS boots.
void SchedulerInitialize();
void SchedulerTerminate();
// Scheduler global singleton object.
extern Scheduler* gScheduler;
#endif