This class represents a queue for executing commands on a device.
More...
#include <talvos/Queue.h>
|
| void | run () |
| | Entry point for background queue thread. More...
|
| |
This class represents a queue for executing commands on a device.
Definition at line 25 of file Queue.h.
| talvos::Queue::Queue |
( |
Device & |
Dev | ) |
|
Create a queue for the specified device.
Definition at line 18 of file Queue.cpp.
| talvos::Queue::~Queue |
( |
| ) |
|
Destroy the queue.
Definition at line 24 of file Queue.cpp.
| talvos::Queue::Queue |
( |
const Queue & |
| ) |
|
|
delete |
| void talvos::Queue::run |
( |
| ) |
|
|
private |
Entry point for background queue thread.
Definition at line 58 of file Queue.cpp.
| void talvos::Queue::submit |
( |
const std::vector< Command * > & |
NewCommands, |
|
|
volatile bool * |
Fence = nullptr |
|
) |
| |
Submit a batch of commands to the queue.
If Fence is not nullptr, its pointee will be set to true when all of the commands have completed.
Definition at line 37 of file Queue.cpp.
| void talvos::Queue::waitIdle |
( |
| ) |
|
Wait until all commands in the queue have completed.
Definition at line 104 of file Queue.cpp.
| std::queue<Command *> talvos::Queue::Commands |
|
private |
The queue of pending commands.
Definition at line 54 of file Queue.h.
The device that this queue will execute work on.
Definition at line 51 of file Queue.h.
| std::set<volatile bool *> talvos::Queue::Fences |
|
private |
A set of pending fences.
Definition at line 57 of file Queue.h.
| std::mutex talvos::Queue::Mutex |
|
private |
Mutex used to guard queue updates.
Definition at line 63 of file Queue.h.
| volatile bool talvos::Queue::Running |
|
private |
Flag to signal whether the queue thread is active.
Definition at line 69 of file Queue.h.
| std::condition_variable talvos::Queue::StateChanged |
|
private |
Condition variable to signal when queue state has changed.
Definition at line 66 of file Queue.h.
| std::thread talvos::Queue::Thread |
|
private |