MemoryMapAgent.cc File Reference

#include <MemoryMapAgent.h>
#include <pthread.h>

Go to the source code of this file.

Defines

#define LOCK()   pthread_mutex_lock(&mutex);
#define UNLOCK()   pthread_mutex_unlock(&mutex);

Functions

OStatus GetMemID (MemoryRegionID memID, void **address)
OStatus FreeMemId (MemoryRegionID memID)
MemoryRegionID RegisterNewMemID (void *addr)

Variables

MemoryRegionID nextMemID = 0
map< MemoryRegionID, void * > memIDsDB
pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER


Define Documentation

 
#define LOCK  )     pthread_mutex_lock(&mutex);
 

Definition at line 30 of file MemoryMapAgent.cc.

Referenced by OpenSdkThread::cleanThreadPool(), OpenSdkThread::deleteThread(), FreeMemId(), GetMemID(), osyslog(), osysprint(), and RegisterNewMemID().

 
#define UNLOCK  )     pthread_mutex_unlock(&mutex);
 

Definition at line 31 of file MemoryMapAgent.cc.

Referenced by OpenSdkThread::cleanThreadPool(), OpenSdkThread::deleteThread(), FreeMemId(), GetMemID(), osyslog(), osysprint(), and RegisterNewMemID().


Function Documentation

OStatus FreeMemId MemoryRegionID  memID  ) 
 

Frees the memory associated with the specified memID and remove also the associated table entry

Definition at line 67 of file MemoryMapAgent.cc.

References LOCK, memIDsDB, and UNLOCK.

Referenced by DeleteSharedMemoryRegion().

OStatus GetMemID MemoryRegionID  memID,
void **  address
 

get the memory address associated with the specified MemoryRegionID returns oFAIL if the memory ID doens't exist, oSUCCESS otherwise

Definition at line 45 of file MemoryMapAgent.cc.

References LOCK, memIDsDB, and UNLOCK.

Referenced by GrowMemoryRegion().

MemoryRegionID RegisterNewMemID void *  addr  ) 
 

Register a new MemoryRegionID. returns the new ID

Definition at line 91 of file MemoryMapAgent.cc.

References LOCK, memIDsDB, nextMemID, and UNLOCK.

Referenced by NewSharedMemoryRegion().


Variable Documentation

map<MemoryRegionID, void*> memIDsDB [static]
 

Definition at line 34 of file MemoryMapAgent.cc.

Referenced by FreeMemId(), GetMemID(), and RegisterNewMemID().

pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER [static]
 

Definition at line 35 of file MemoryMapAgent.cc.

MemoryRegionID nextMemID = 0 [static]
 

Definition at line 33 of file MemoryMapAgent.cc.

Referenced by RegisterNewMemID().


Generated on Sun Dec 2 23:04:31 2007 for openSDK by  doxygen 1.3.9.1