un get qui marche?

This commit is contained in:
stormrider1982 2004-02-25 08:48:23 +00:00 committed by Glenn Y. Rolland
parent f382aaa84c
commit ea9781fbd7

View file

@ -7,7 +7,9 @@ void * msgGet(msgSpace * space,int queueIndex,int option){
msgQueueId queueId;
msgQueue * queue;
msgQueueElemId oldElemId;
msgQueueElem * oldElem;
msgQueueElem * oldElem;
int poolIndex;
// on teste la possibilité de lecture sur la liste...
if (option == NONBLOCK){
if (msgQueueReadTryLock(space->externId,queueIndex) <0){
@ -30,8 +32,9 @@ void * msgGet(msgSpace * space,int queueIndex,int option){
// recupérer l'id de l'ancien element...
msgQueueRem(queue, oldElemId);
oldElem = msgQueueElemOpen(oldElemId);
oldElem = msgQueueElemOpen(oldElemId);
poolIndex=oldElem->poolIndex;
/* on récupere la taille des buffer dans la pool du buffer */
int bufferSize;
msgPoolData * poolDataTab;
@ -47,9 +50,19 @@ void * msgGet(msgSpace * space,int queueIndex,int option){
bufferNb=mSPoolDataTabAddr[selectedPoolIndex].bufferNb;
*/
/* TODO: ecrire msgBufferMap(space,poolIndex,bufferIndex) */
resultAddr = msgBufferMap(poolDataTab, poolIndex, 0);
if(resultAddr == NULL) {
NZG_ERROR("BufferMap", poolDataTab->poolId);
goto ERROR;
}
// attacher au buffer...
msgBufferAttachProc(poolDataTab,
poolIndex,
0, // c le buff en tete de file....
resultAddr);
// fermer la file
msgQueueClose(queue);