#include <interrupt/gatequeue.h>
Public Member Functions | |
| bool | enqueue (Gate *item) |
| Enqueues the provided item at the end of the queue. More... | |
| Gate * | dequeue () |
| Removes the first element in the queue and returns it. More... | |
Queue for Gates.
While for OOStuBS a simple linked list is sufficient (by having a head pointer in this calls and extending Gate with a next pointer), for multi-core systems like MPStuBS it needs to be able to enqueue the same Gate item on each Core (up to Core::MAX) at the same time (a multi-queue, requiring a head pointer array member in this class and a next pointer array in Gate).
| bool GateQueue::enqueue | ( | Gate * | item | ) |
Enqueues the provided item at the end of the queue.
In MPStuBS the item is added to the internal queue belonging to the core it is currently executed on.
| item | Queue element to be appended. |
true if successfully added to the queue, false if it is already in the queue| Gate * GateQueue::dequeue | ( | ) |
Removes the first element in the queue and returns it.
In MPStuBS the item is retrieved from the internal queue belonging to the core it is currently executed on.
nullptr if the queue was empty.