My Project
Public Types | Public Member Functions | List of all members
ParaEngine::PoolThreadSafe< UserAllocator, Mutex > Class Template Reference

this is a thread safe version of boost::pool. More...

#include <PoolBase.h>

Inheritance diagram for ParaEngine::PoolThreadSafe< UserAllocator, Mutex >:

Public Types

typedef UserAllocator::size_type size_type
 
typedef UserAllocator::difference_type difference_type
 
typedef Mutex mutex_type
 
typedef boost::pool< UserAllocator > pool_type
 

Public Member Functions

 PoolThreadSafe (const size_type nrequested_size, const size_type nnext_size=32)
 
void * malloc ()
 
void free (void *const chunk)
 

Detailed Description

template<typename UserAllocator, typename Mutex>
class ParaEngine::PoolThreadSafe< UserAllocator, Mutex >

this is a thread safe version of boost::pool.

It derives from boost:pool, but use a lock for its malloc and free function. e.g. PoolThreadSafe<> s_memPool(32); char* A = s_memPool.malloc(); s_memPool.free(A);


The documentation for this class was generated from the following file: