*** empty log message ***

This commit is contained in:
glenux 2004-03-07 12:53:25 +00:00
parent 3d75566a88
commit 309678b6f4
10 changed files with 26 additions and 22 deletions

View file

@ -3,6 +3,7 @@
#define DEBUG 0
int msgQueueProtLock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd;
msgQueueSemId queueSemId;
@ -18,13 +19,11 @@ int msgQueueProtLock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_wait",queueSemId);
goto ERROR;
}
int semval=0;
semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
sem_close(queueSemFd);
sem_close(queueSemFd);
return 0;

View file

@ -4,6 +4,7 @@
#define DEBUG 0
int msgQueueProtUnlock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd;
msgQueueSemId queueSemId;
@ -20,7 +21,7 @@ int msgQueueProtUnlock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_post",queueSemId);
goto ERROR;
}
int semval=0;
semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }

View file

@ -4,6 +4,7 @@
#define DEBUG 0
int msgQueueReadLock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd;
msgQueueSemId queueSemId;
@ -19,7 +20,7 @@ int msgQueueReadLock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_wait",queueSemId);
goto ERROR;
}
int semval=0;
semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }

View file

@ -4,6 +4,7 @@
#define DEBUG 0
int msgQueueReadTryLock(msgSpaceId externId,int queueIdx){
int semval;
sem_t * queueSemFd;
msgQueueSemId queueSemId;
@ -19,9 +20,9 @@ int msgQueueReadTryLock(msgSpaceId externId,int queueIdx){
goto ERROR;
}
if (DEBUG) { printf("Locking %s\n",queueSemId); }
int semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
sem_close(queueSemFd);

View file

@ -4,12 +4,13 @@
#define DEBUG 0
int msgQueueReadUnlock(msgSpaceId externId,int queueIdx){
sem_t * queueSemFd;
int semval;
sem_t * queueSemFd;
msgQueueSemId queueSemId;
msgQueueReadSemIdIntern(queueSemId,externId,queueIdx);
if (DEBUG) { printf("Unlocking %s\n",queueSemId); }
queueSemFd=sem_open(queueSemId,O_CREAT,SEM_DEFAULT_MODE,1);
queueSemFd=sem_open(queueSemId,O_CREAT,SEM_DEFAULT_MODE,1);
if(queueSemFd==SEM_FAILED){
NZG_ERROR("sem_open",queueSemId);
goto ERROR;
@ -19,9 +20,9 @@ int msgQueueReadUnlock(msgSpaceId externId,int queueIdx){
NZG_ERROR("sem_post",queueSemId);
goto ERROR;
}
int semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
semval=0;
sem_getvalue(queueSemFd,&semval);
if (DEBUG) { printf("(AfterValue:%d)\n",semval); }
sem_close(queueSemFd);

View file

@ -22,8 +22,10 @@ msgSpace * msgSpaceCreate(
/* msgSpaceList mSList; */
int mSFd; // shm file descriptor
int i;
int err;
static int mSIdNum=-1;
msgSpace * space;
msgSpaceListElemId listElemId;
msgPoolDataTabId poolDataTabId;
msgPoolData * poolDataTabAddr;
@ -50,7 +52,6 @@ msgSpace * msgSpaceCreate(
NZG_ERROR("msgSpaceListLock","");
goto ERROR;
}
int err;
if ((err=msgSpaceListFindId(externId)) < 1){
if (err==0){
// soit le msgSpace existe deja
@ -173,7 +174,6 @@ msgSpace * msgSpaceCreate(
}
msgPoolDataTabClose(space,poolDataTabAddr);
/* on ajoute spaceId a la liste des msgSpace connus */
msgSpaceListElemId listElemId;
printf("spaceListInit...\n");
printf("ok\n");

View file

@ -8,11 +8,11 @@ int msgPoolDataTabSemIdIntern(
msgPoolSemId destSemId,const msgSpaceId externId);
int msgSpaceDelete(msgSpaceId externId){
fprintf(stderr,"Deleting msgSpace with id : %s\n",externId);
//int shmId;
msgSpaceId nzgId;
msgSpace * space;
int i;
fprintf(stderr,"Deleting msgSpace with id : %s\n",externId);
if (msgSpaceIdIntern(nzgId,externId) == -1){
NZG_ERROR("msgSpaceIdIntern",externId);
goto ERROR;

View file

@ -7,8 +7,9 @@ int msgSpaceListElemCreate(
msgSpace * space)
{
msgSpaceListElemIdIntern(listElemId,space->externId);
int listElemFd;
msgSpaceListElem * listElem;
msgSpaceListElemIdIntern(listElemId,space->externId);
listElemFd=shm_open(listElemId,
O_RDWR|O_CREAT|O_EXCL|O_TRUNC,
@ -25,7 +26,6 @@ int msgSpaceListElemCreate(
}
close(listElemFd);
msgSpaceListElem * listElem;
listElem=msgSpaceListElemOpen(listElemId);
if (listElem ==NULL){
NZG_ERROR("msgSpaceListElemOpen",listElemId);

View file

@ -5,11 +5,11 @@
int msgSpaceListFindId(msgSpaceId externId){
msgSpaceList * list;
msgSpaceId spaceId;
msgSpaceIdIntern(spaceId,externId);
msgSpaceListElemId listHeadElemId;
msgSpaceListElemId listTailElemId;
msgSpaceListId listId;
msgSpaceIdIntern(spaceId,externId);
list=msgSpaceListOpen();
if (list==NULL){
NZG_ERROR("msgSpaceListOpen","");

View file

@ -4,9 +4,11 @@
int msgSpaceListInit(){
int spaceListFd;
sem_t * spaceListSemFd;
msgSpaceList *list;
msgSpaceListSemId spaceListSemId;
msgSpaceListId spaceListId;
strcpy(spaceListSemId,DEFAULT_MSGSPACELISTSEMID);
strcpy(spaceListId,DEFAULT_MSGSPACELISTID);
@ -42,7 +44,6 @@ int msgSpaceListInit(){
}
close(spaceListFd);
msgSpaceList *list;
list=msgSpaceListOpen();
if (list == NULL){
NZG_ERROR("msgSpaceListOpen","");
@ -65,7 +66,7 @@ int msgSpaceListInit(){
ERROR:
return -1;
EXISTING:
if (msgSpaceListUnlock() < 0){
if (msgSpaceListUnlock() < 0){
NZG_ERROR("msgSpaceListUnlock","");
goto ERROR;
}