UCommon
|
A mempager source of reusable objects. More...
#include <reuse.h>
Protected Member Functions | |
bool | avail (void) const |
ReusableObject * | get (void) |
ReusableObject * | get (timeout_t timeout) |
PagerReuse (mempager *pager, size_t objsize, unsigned count) | |
ReusableObject * | request (void) |
![]() | |
virtual void * | _alloc (size_t size) |
MemoryRedirect (MemoryProtocol *protocol) | |
![]() | |
ReusableObject * | next (ReusableObject *object) |
Get next reusable object in the pool. More... | |
void | release (ReusableObject *object) |
Release resuable object. More... | |
ReusableAllocator () | |
Initialize reusable allocator through a conditional. More... | |
![]() | |
void | broadcast (void) |
Signal the conditional to release all waiting threads. | |
Conditional () | |
Initialize and construct conditional. | |
void | signal (void) |
Signal the conditional to release one waiting thread. | |
bool | wait (timeout_t timeout) |
Conditional wait for signal on millisecond timeout. More... | |
bool | wait (struct timespec *timeout) |
Conditional wait for signal on timespec timeout. More... | |
void | wait (void) |
Wait (block) until signalled. | |
~Conditional () | |
Destroy conditional, release any blocked threads. | |
![]() | |
ConditionMutex () | |
Initialize and construct conditional. | |
void | lock (void) |
Lock the conditional's supporting mutex. | |
void | unlock (void) |
Unlock the conditional's supporting mutex. | |
~ConditionMutex () | |
Destroy conditional, release any blocked threads. | |
Additional Inherited Members | |
![]() | |
static pthread_condattr_t * | initializer (void) |
Support function for getting conditional attributes for realtime scheduling. More... | |
static void | set (struct timespec *hires, timeout_t timeout) |
Convert a millisecond timeout into use for high resolution conditional timers. More... | |
![]() | |
ReusableObject * | freelist |
unsigned | waiting |
![]() | |
pthread_cond_t | cond |
![]() | |
pthread_mutex_t | mutex |
![]() | |
static attribute | attr |
A mempager source of reusable objects.
This is used by the reuse_pager template to allocate new objects either from a memory pager used as a private heap, or from previously allocated objects that have been returned for reuse.