The records one pool has created, its free list and its live count, used by one thread at a time: the owning creator for CreatorRecordPool, the holder of the guard mutex for ExternalRecordPool.
More...
#include "donner/base/tasks/TaskRecord.h"
|
| | RecordStore (std::size_t maxLiveRecords) |
|
| RecordStore (const RecordStore &)=delete |
|
RecordStore & | operator= (const RecordStore &)=delete |
|
| ~RecordStore () |
| | Deletes every record. Every record must be back on the free list.
|
| TaskRecord * | allocate (const void *pool) |
| | Takes a record from the free list, or creates one while fewer than the bound exist.
|
|
void | release (TaskRecord *record) |
| | Puts one record back on the free list. It must hold no closure.
|
| std::size_t | releaseList (TaskRecord *head) |
| | Puts a list of records, linked through their links and already poisoned, back on the free list.
|
|
bool | hasFreeRecord () const |
| | Whether the free list holds a record.
|
|
std::size_t | liveCount () const |
| | Records allocated and not yet back on the free list.
|
|
std::size_t | createdCount () const |
| | Records created so far; never above maxLiveRecords.
|
|
std::size_t | maxLiveRecords () const |
| | The bound on live records.
|
The records one pool has created, its free list and its live count, used by one thread at a time: the owning creator for CreatorRecordPool, the holder of the guard mutex for ExternalRecordPool.
◆ RecordStore()
| donner::tasks::RecordStore::RecordStore |
( |
std::size_t | maxLiveRecords | ) |
|
|
inlineexplicit |
- Parameters
-
| maxLiveRecords | The most records the pool creates; a record is live from allocation until it is back on the free list. |
◆ allocate()
| TaskRecord * donner::tasks::RecordStore::allocate |
( |
const void * | pool | ) |
|
|
inlinenodiscard |
Takes a record from the free list, or creates one while fewer than the bound exist.
- Parameters
-
| pool | Identity stored in the record. |
- Returns
- The record, or null when the bound is reached and the free list is empty.
◆ releaseList()
| std::size_t donner::tasks::RecordStore::releaseList |
( |
TaskRecord * | head | ) |
|
|
inline |
Puts a list of records, linked through their links and already poisoned, back on the free list.
- Parameters
-
| head | First record of the list. |
- Returns
- The number of records.
The documentation for this class was generated from the following file: