Class Guard

Class Guard

Placement in the overall structure

Module
guard
Base classes
Locker
Derived classes
None
Time of creation
Task 3
Files
guard.h guard.cc

Description

The Guard class is used for synchronization between "normal" kernel activities (currently outputs, later system calls) and interrupt handling routines. For this purpose Guard has a queue (a Queue object) into which Gate objects can be enqueued. This is always necessary if the critical section is occupied at the time an interrupt occurs, so the epilogue() method may not be processed immediately. The accumulated epilogues are handled as soon as the critical section is released again.

Public methods

void leave ()
Regular control flow leaves the critical section. Accumulated epilogues can be processed now.
void relay (Gate* item)
This method is called by guardian () if the previously executed prologue has indicated by a return value of true that its epilogue should be executed. Whether the epilogue is handled immediately or only added to the epilogue queue depends on whether the critical section is free or occupied.

Notes