The shared mempager uses a mutex to protect key access methods.
More...
#include <misc.h>
|
| | SharedMemPager (size_t pagesize=4096, const char *name=NULL) |
| | Create a mempager mutex pool.
|
| |
| void | purge (void) |
| | Purge the memory pool while locked.
|
| |
| void * | first (size_t size) |
| | Get the first memory page after locking.
|
| |
| void * | alloc (size_t size) |
| | Get the last memory page after locking.
|
| |
|
| | Mutex (const char *name=NULL) |
| | The mutex is always initialized as a recursive entity.
|
| |
| virtual | ~Mutex () |
| | Destroying the mutex removes any system resources associated with it.
|
| |
| void | nameMutex (const char *name) |
| | Enable setting of mutex name for deadlock debug.
|
| |
| void | enterMutex (void) |
| | Entering a Mutex locks the mutex for the current thread.
|
| |
| void | enter (void) |
| | Future abi will use enter/leave/test members.
|
| |
| void | leave (void) |
| | Future abi will use enter/leave/test members.
|
| |
| bool | test (void) |
| | Future abi will use enter/leave/test members.
|
| |
| bool | tryEnterMutex (void) |
| | Tries to lock the mutex for the current thread.
|
| |
| void | leaveMutex (void) |
| | Leaving a mutex frees that mutex for use by another thread.
|
| |
| static void | setDebug (bool mode) |
| | Enable or disable deadlock debugging.
|
| |
The shared mempager uses a mutex to protect key access methods.
This class is used when a mempager will be shared by multiple threads.
- Author
- David Sugar dyfet.nosp@m.@ost.nosp@m.el.co.nosp@m.m
mutex protected memory pager.
◆ SharedMemPager()
| ost::SharedMemPager::SharedMemPager |
( |
size_t | pagesize = 4096, |
|
|
const char * | name = NULL ) |
|
protected |
Create a mempager mutex pool.
- Parameters
-
| pagesize | page size for allocation. |
| name | a name for the pool. |
◆ alloc()
| void * ost::SharedMemPager::alloc |
( |
size_t | size | ) |
|
|
protectedvirtual |
Get the last memory page after locking.
- Returns
- allocated memory space.
- Parameters
-
Reimplemented from ost::MemPager.
◆ first()
| void * ost::SharedMemPager::first |
( |
size_t | size | ) |
|
|
protectedvirtual |
Get the first memory page after locking.
- Returns
- allocated memory space.
- Parameters
-
Reimplemented from ost::MemPager.
◆ purge()
| void ost::SharedMemPager::purge |
( |
void | | ) |
|
|
protected |
Purge the memory pool while locked.
The documentation for this class was generated from the following file: