*** empty log message ***

This commit is contained in:
glenux 2004-02-25 11:22:38 +00:00 committed by Glenn Y. Rolland
parent 97ef840f3a
commit 0e0a5f6748
2 changed files with 20 additions and 33 deletions

View file

@ -6,25 +6,20 @@ int msgFree(msgSpace * space, void * addr){
int poolIndex;
int bufferIndex;
msgPoolData * poolDataTabAddr;
sem_t * poolDataTabSemFd;
msgPoolDataTabSemId ressourceSemId;
sem_t * ressourceSemFd;
/* on acquiert le droit de modifier les infos sur la ressource */
msgPoolDataTabSemId ressourceSemId;
/* on acquiert le droit de modifier les infos sur la ressource */
/* on protege le tableau des associations */
poolDataTabSemFd=sem_open(space->poolDataTabSemId,
O_CREAT,SEM_DEFAULT_MODE,1);
if (poolDataTabSemFd == SEM_FAILED){
NZG_ERROR("sem_open : ouverture de la ressource",
space->poolDataTabSemId);
return -1;
}
sem_wait(poolDataTabSemFd);
if (msgPoolDataTabLock(space) <0){
NZG_ERROR("msgPoolDataTabLock",space->poolDataTabSemId);
goto ERROR;
};
/* verifier le premier arg du shm_open */
poolDataTabAddr = msgPoolDataTabOpen(space);
// TODO: verouiller semaphore DataInfo
// TODO: verouiller semaphore DataInfo ??
int err;
poolIndex=-1; bufferIndex=-1;
@ -51,8 +46,6 @@ sem_t * poolDataTabSemFd;
// deverouiller semaphore DataInfo
msgPoolDataTabUnlock(space);
// sem_post(poolDataTabSemFd);
// sem_close(poolDataTabSemFd);
// deverouiller semaphore ressource.
msgPoolSemIdIntern(ressourceSemId,space->id,poolIndex);

View file

@ -26,24 +26,18 @@ int main(void) {
}
printf("CREATION ------------------ ok\n");
sleep(1);
pid_t pid=fork();
if (pid ==0){
mSPAC=msgSpaceOpen(testId);
sleep(2);
printf("Get..."); fflush(stdout);
montext=msgGet(mSPAC,0,0);
printf("get-ok\n");
} else {
mSPAC=msgSpaceOpen(testId);
montext=msgAllocate(mSPAC,2,280,0);
*montext=42;
printf("### test Valeur0 %d ###\n",(int)*montext);
printf("Put..."); fflush(stdout);
msgPut(mSPAC,0,montext);
printf("put-ok\n");
//sleep(2);
}
mSPAC=msgSpaceOpen(testId);
montext=msgAllocate(mSPAC,2,280,0);
*montext=42;
printf("### test Valeur0 %d ###\n",(int)*montext);
printf("Put..."); fflush(stdout);
msgPut(mSPAC,0,montext);
printf("put-ok\n");
printf("Get..."); fflush(stdout);
montext=msgGet(mSPAC,0,0);
printf("get-ok\n");
return 0;
}