diff --git a/src/allocate.c b/src/allocate.c index cce3b92..b848053 100644 --- a/src/allocate.c +++ b/src/allocate.c @@ -186,14 +186,14 @@ void * msgAllocate(msgSpace *space, int bufferFreeSize; bufferFreeSize=mSPoolDataTabAddr[selectedPoolIndex].bufferSize; printf("BufferSize : %d", bufferFreeSize); - + + bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb; // on mappe la totalité du pool resultAddr = mmap( NULL, bufferFreeSize*bufferNb, /* bufferFreeSize*/ PROT_NONE, //prot PROT_READ | PROT_WRITE MAP_SHARED, mSPoolFd, (off_t)0); - bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb; // mprotect(resultAddr,bufferFreeSize*bufferNb,PROT_NONE); mprotect(resultAddr,bufferFreeSize*(bufferFreeIndex+1),PROT_READ|PROT_WRITE); diff --git a/src/put.c b/src/put.c index 818dd74..d035101 100644 --- a/src/put.c +++ b/src/put.c @@ -21,6 +21,7 @@ int msgPut(msgSpace * space,int queueIndex, void * addr){ msgQueueId queueId; msgQueue * queue; msgQueueIdIntern(queueId,space->externId,queueIndex); + msgQueueProtLock(space->externId,queueIndex); queue = msgQueueOpen(queueId);