#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 queue is sufficient (by 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 at the same time (a multi-queue, requiring multiple next pointers 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 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 queue belonging to the core it is currently executed on.
nullptr if the queue was empty.