Class Guarded_Scheduler

Class Guarded_Scheduler

Placement in the overall structure

Module
syscall
Base classes
Scheduler
Derived classes
None
Time of creation
Task 5
Files
guarded_scheduler.h guarded_scheduler.cc

Description

The Guarded_Scheduler implements the system call interface to the Scheduler. The methods it offers are mapped directly to the methods of the base class, except that their execution is protected in each case with the help of an object of the Secure class, and that Thread objects are handled instead of Entrant objects.

Public methods

void ready (Thread& that)
This method registers the process that with the scheduler.
void exit ()
With this method, a process can terminate itself.
void kill (Thread& that)
With this method, a process can kill another (that).
void resume ()
This method can be used to trigger a process switch.

Notes

Since the methods of Guarded_Scheduler have the same names as those of the Scheduler base class, they normally hide them. This can be prevented if the name of the base class is explicitly specified when a method is called. Examples:
   Guarded_Scheduler scheduler;
   Application appl1, appl2;

   scheduler.ready (appl1);                // Method of Guarded_Scheduler
   scheduler.Scheduler::ready (appl2);     // Method of Scheduler