|
The Pedigree Project 0.1
|
#include <RequestQueue.h>
Collaboration diagram for RequestQueue::PreallocatedRequest:Public Types | |
| using | ReleaseCallback = void(*)(void *) |
Public Member Functions | |
| PreallocatedRequest (ReleaseCallback releaseCallback, void *releaseContext) | |
| bool | isAvailable () const |
Private Types | |
| enum | State { Idle , Claimed , Published , Releasing } |
Private Member Functions | |
| NOT_COPYABLE_OR_ASSIGNABLE (PreallocatedRequest) | |
Private Attributes | |
| Request | m_Request |
| Atomic< size_t > | m_State |
| Atomic< size_t > | m_ReleaseDepth |
| ReleaseCallback | m_ReleaseCallback |
| void * | m_ReleaseContext |
Friends | |
| class | RequestQueue |
Single preallocated publication slot for allocation-free producers.
Use one token per logical source. Republishing the same token coalesces work until the queued request has executed or been cancelled.
The owner must keep this object alive until isAvailable() is true. A successful publication transfers payload ownership to the queue; every rejection leaves ownership with the caller. An optional release callback runs after execution or cancellation, outside the request-list and waiter guard. The token remains unavailable until it returns. Its release callback is a callback boundary: lifecycle and ordinary publication calls on this queue are rejected before they can block or allocate. The explicit Releasing-token handoff below remains the one allocation-free way to preserve an already-observed follow-up. The callback can run on the queue worker, a teardown thread, or inline when threading is disabled. It must be bounded and nonblocking, and must not enter queue lifecycle operations or destroy the queue or token.
Definition at line 224 of file RequestQueue.h.
| using RequestQueue::PreallocatedRequest::ReleaseCallback = void (*)(void*) |
Definition at line 226 of file RequestQueue.h.
|
private |
Definition at line 238 of file RequestQueue.h.
| RequestQueue::PreallocatedRequest::PreallocatedRequest | ( | ) |
Definition at line 177 of file RequestQueue.cc.
| RequestQueue::PreallocatedRequest::PreallocatedRequest | ( | ReleaseCallback | releaseCallback, |
| void * | releaseContext | ||
| ) |
Definition at line 179 of file RequestQueue.cc.
| RequestQueue::PreallocatedRequest::~PreallocatedRequest | ( | ) |
Definition at line 187 of file RequestQueue.cc.
| bool RequestQueue::PreallocatedRequest::isAvailable | ( | ) | const |
Definition at line 193 of file RequestQueue.cc.
|
friend |
Definition at line 235 of file RequestQueue.h.
|
private |
Definition at line 248 of file RequestQueue.h.
|
private |
Definition at line 249 of file RequestQueue.h.
|
private |
Definition at line 247 of file RequestQueue.h.
|
private |
Definition at line 245 of file RequestQueue.h.
|
private |
Definition at line 246 of file RequestQueue.h.