*** empty log message ***
This commit is contained in:
parent
38ce79adda
commit
7d5bed91a1
2 changed files with 33 additions and 0 deletions
29
src/get.c
29
src/get.c
|
@ -0,0 +1,29 @@
|
|||
#include "libnazgul.h"
|
||||
|
||||
#define NONBLOCK -1
|
||||
|
||||
void * msgGet(msgSpace * space,int queueIndex,int option){
|
||||
void * resultAddr;
|
||||
// on teste la possibilité de lecture sur la liste...
|
||||
if (option == NONBLOCK){
|
||||
if (msgQueueReadTryLock(space->externId,queueIndex) <0){
|
||||
NZG_ERROR("msgQueueReadTryLock",space->externId);
|
||||
goto ERROR;
|
||||
}
|
||||
} else {
|
||||
if (msgQueueReadLock(space->externId,queueIndex) <0){
|
||||
NZG_ERROR("msgQueueReadLock",space->externId);
|
||||
goto ERROR;
|
||||
}
|
||||
}
|
||||
// la lecture est possible
|
||||
// on essaye donc de modifier la liste
|
||||
msgQueueProtLock(space->externId,queueIndex);
|
||||
|
||||
// on a fini de modifier la liste
|
||||
msgQueueProtUnlock(space->externId,queueIndex);
|
||||
|
||||
return resultAddr;
|
||||
ERROR:
|
||||
return NULL;
|
||||
}
|
|
@ -19,6 +19,8 @@ int msgBufferInfoTabCreate(msgSpaceId externId, msgPoolData *poolDataTabAddr, in
|
|||
int msgBufferInfoTabInit(msgPoolData *poolDataTabAddr, int poolIndex);
|
||||
/* free.c */
|
||||
int msgFree(msgSpace *space, void *addr);
|
||||
/* get.c */
|
||||
void *msgGet(msgSpace *space, int queueIndex, int option);
|
||||
/* ids.c */
|
||||
int msgSpaceIdIntern(msgSpaceId dest, const msgSpaceId src);
|
||||
int msgPoolDataTabSemIdIntern(msgPoolSemId destSemId, const msgSpaceId externId);
|
||||
|
@ -70,6 +72,8 @@ int msgQueueProtLock(msgSpaceId externId, int queueIdx);
|
|||
int msgQueueProtUnlock(msgSpaceId externId, int queueIdx);
|
||||
/* queueReadLock.c */
|
||||
int msgQueueReadLock(msgSpaceId externId, int queueIdx);
|
||||
/* queueReadTryLock.c */
|
||||
int msgQueueReadTryLock(msgSpaceId externId, int queueIdx);
|
||||
/* queueReadUnlock.c */
|
||||
int msgQueueReadUnlock(msgSpaceId externId, int queueIdx);
|
||||
/* queueRem.c */
|
||||
|
|
Loading…
Reference in a new issue