18 #ifndef LUNCHBOX_POOL_H 19 #define LUNCHBOX_POOL_H 21 #include <lunchbox/scopedMutex.h> 22 #include <lunchbox/spinLock.h> 23 #include <lunchbox/thread.h> 29 class Pool :
public boost::noncopyable
43 T* item = _cache.back();
52 _cache.push_back(item);
59 while (!_cache.empty())
68 std::vector<T*> _cache;
71 #endif // LUNCHBOX_POOL_H
A fast lock for uncontended memory access.
A thread-safe object allocation pool.
void release(T *item)
Release an item for reuse.
Abstraction layer and common utilities for multi-threaded programming.
void flush()
Delete all cached items.
Pool()
Construct a new pool.
virtual ~Pool()
Destruct this pool.