* spaceState

This commit is contained in:
glenux 2004-02-26 10:21:55 +00:00
parent 4af7e769b3
commit ed0068913d
4 changed files with 11 additions and 6 deletions

View file

@ -82,6 +82,8 @@ int msgQueueReadTryLock(msgSpaceId externId, int queueIdx);
int msgQueueReadUnlock(msgSpaceId externId, int queueIdx);
/* queueRem.c */
int msgQueueRem(msgQueue *queue, msgQueueElemId oldElemId);
/* spaceClose.c */
int msgSpaceClose(msgSpace *space);
/* spaceCreate.c */
msgSpace *msgSpaceCreate(msgSpaceId externId, int queueNb, int poolNb, msgPool *poolInfos);
/* spaceDelete.c */
@ -98,7 +100,7 @@ int msgSpaceListElemCreate(msgSpaceListElemId listElemId, msgSpace *space);
/* spaceListElemOpen.c */
void *msgSpaceListElemOpen(msgSpaceListElemId listElemId);
/* spaceListFindId.c */
int msgSpaceListFindId(msgSpaceId spaceId);
int msgSpaceListFindId(msgSpaceId externId);
int msgSpaceListElemFindId(msgSpaceListElemId elemId, msgSpaceId spaceId);
/* spaceListInit.c */
int msgSpaceListInit(void);
@ -111,6 +113,6 @@ void *msgSpaceListOpen(void);
int msgSpaceListRem(msgSpaceId spaceId);
/* spaceOpen.c */
msgSpace *msgSpaceOpen(msgSpaceId externId);
/* state.c */
/* spaceState.c */
#endif

View file

@ -46,14 +46,12 @@ msgSpace * msgSpaceCreate(
NZG_ERROR("msgSpaceListInit",nzgId);
goto ERROR;
};
printf("spaceListInit ok\n");
if (msgSpaceListLock() <0){
NZG_ERROR("msgSpaceListLock","");
goto ERROR;
}
printf("spaceListLock ok\n");
int err;
if ((err=msgSpaceListFindId(nzgId)) < 1){
if ((err=msgSpaceListFindId(externId)) < 1){
if (err==0){
// soit le msgSpace existe deja
NZG_ERROR("spaceListFindId : existing ",nzgId);

View file

@ -2,8 +2,11 @@
#define DEBUG 1
int msgSpaceListFindId(msgSpaceId spaceId){
int msgSpaceListFindId(msgSpaceId externId){
msgSpaceList * list;
msgSpaceId spaceId;
msgSpaceIdIntern(spaceId,externId);
msgSpaceListElemId listHeadElemId;
msgSpaceListElemId listTailElemId;
msgSpaceListId listId;

View file

@ -43,6 +43,8 @@ if (pid==0){
printf("get-ok\n");
printf("### test Reception %d ###\n",(int)*montext);
msgFree(mSPAC,montext);
wait(NULL);
msgSpaceDelete(testId);
}
return 0;
}