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

View file

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

View file

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

View file

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