*** empty log message ***

This commit is contained in:
glenux 2004-02-24 09:54:05 +00:00 committed by Glenn Y. Rolland
parent 55bdcbca9d
commit e86a28a0c3
5 changed files with 69 additions and 36 deletions

View file

@ -50,8 +50,9 @@ sem_t * poolDataTabSemFd;
msgPoolDataTabClose(space,poolDataTabAddr); msgPoolDataTabClose(space,poolDataTabAddr);
// deverouiller semaphore DataInfo // deverouiller semaphore DataInfo
sem_post(poolDataTabSemFd); msgPoolDataTabUnlock(space);
sem_close(poolDataTabSemFd); // sem_post(poolDataTabSemFd);
// sem_close(poolDataTabSemFd);
// deverouiller semaphore ressource. // deverouiller semaphore ressource.
msgPoolSemIdIntern(ressourceSemId,space->id,poolIndex); msgPoolSemIdIntern(ressourceSemId,space->id,poolIndex);

0
src/get.c Normal file
View file

View file

@ -0,0 +1,29 @@
#include "libnazgul.h"
#include "ids.h"
int msgPoolDataTabUnlock(msgSpace * space){
sem_t * poolDataTabSemFd;
poolDataTabSemFd=sem_open(
space->poolDataTabSemId
,O_CREAT,
SEM_DEFAULT_MODE,
1);
if(poolDataTabSemFd==SEM_FAILED){
NZG_ERROR("sem_open",space->poolDataTabSemId);
goto ERROR;
}
if(sem_post(poolDataTabSemFd)==-1){
NZG_ERROR("sem_post",space->poolDataTabSemId);
goto ERROR;
}
sem_close(poolDataTabSemFd);
return 0;
ERROR:
return -1;
}

View file

@ -41,6 +41,7 @@ int msgPoolDataTabLock(msgSpace *space);
/* poolDataTabOpen.c */ /* poolDataTabOpen.c */
void *msgPoolDataTabOpen(msgSpace *space); void *msgPoolDataTabOpen(msgSpace *space);
/* poolDataTabUnlock.c */ /* poolDataTabUnlock.c */
int msgPoolDataTabUnlock(msgSpace *space);
/* poolDelete.c */ /* poolDelete.c */
int msgPoolDelete(msgSpaceId spaceId, int poolIdx); int msgPoolDelete(msgSpaceId spaceId, int poolIdx);
/* put.c */ /* put.c */

View file

@ -1,15 +1,15 @@
#include "libnazgul.h" #include "libnazgul.h"
int msgPut(msgSpace * space,int queueIndex, void * addr){ int msgPut(msgSpace * space,int queueIndex, void * addr){
// retrouver le pool, buffer qui correspondent à l'addresse... // retrouver le pool, buffer qui correspondent à l'addresse...
msgPoolData * poolDataTabAddr; msgPoolData * poolDataTabAddr;
int poolIndex; int poolIndex;
int bufferIndex; int bufferIndex;
int err; int err;
msgPoolDataTabLock(space); msgPoolDataTabLock(space);
poolDataTabAddr=msgPoolDataTabOpen(space); poolDataTabAddr=msgPoolDataTabOpen(space);
err=msgBufferGetProcAttach( err=msgBufferGetProcAttach(
poolDataTabAddr, poolDataTabAddr,
space->poolNb, space->poolNb,
&poolIndex, &poolIndex,
@ -17,41 +17,43 @@ int err;
addr addr
); );
// ouvrir la queue avec le bon index
msgQueueId queueId;
msgQueue * queue;
msgQueueIdIntern(queueId,space->externId,queueIndex);
msgQueueProtLock(space->externId,queueIndex);
queue = msgQueueOpen(queueId);
// ouvrir la queue avec le bon index // TODO:creer un element vide
msgQueueId queueId; msgQueueElemId newElemId;
msgQueue * queue; msgQueueElem * queueElem;
msgQueueIdIntern(queueId,space->externId,queueIndex);
msgQueueProtLock(space->externId,queueIndex);
queue = msgQueueOpen(queueId);
// TODO:creer un element vide
msgQueueElemId newElemId;
msgQueueElem * queueElem;
msgQueueElemCreate(newElemId,queueId,queue->elemCounter); msgQueueElemCreate(newElemId,queueId,queue->elemCounter);
// ouvrir l'element // ouvrir l'element
queueElem=msgQueueElemOpen(newElemId); queueElem=msgQueueElemOpen(newElemId);
// modifier les index pour retrouver le buffer
queueElem->poolIndex=poolIndex;
queueElem->bufferIndex=bufferIndex;
// fermer l'element
msgQueueElemClose(queueElem);
//ajouter le message a la bonne file... // modifier les index pour retrouver le buffer
msgQueueElemAdd(queue,newElemId); queueElem->poolIndex=poolIndex;
queueElem->bufferIndex=bufferIndex;
// fermer l'element
msgQueueElemClose(queueElem);
// fermer la file //ajouter le message a la bonne file...
msgQueueClose(queue); msgQueueElemAdd(queue,newElemId);
msgQueueProtUnlock(space->externId,queueIndex);
msgPoolDataTabClose(space,poolDataTabAddr); // fermer la file
/* msgPoolDataTabUnlock(space->id); msgQueueClose(queue);
*/ msgQueueProtUnlock(space->externId,queueIndex);
msgQueueReadUnlock(space->externId,queueIndex);
return 0; msgPoolDataTabClose(space,poolDataTabAddr);
msgPoolDataTabUnlock(space);
// on laisse une nouvelle ressource de la liste au get
msgQueueReadUnlock(space->externId,queueIndex);
return 0;
ERROR: ERROR:
return -1; return -1;
} }