*** empty log message ***
This commit is contained in:
parent
2eadee7153
commit
764eaa5e21
2 changed files with 24 additions and 2 deletions
|
@ -1,10 +1,11 @@
|
|||
#include "libnazgul.h"
|
||||
#include "ids.h"
|
||||
|
||||
int queueLock(msgSpaceId externId,int queueIdx){
|
||||
sem_t * queueSemFd;
|
||||
msgQueueSemId queueSemId;
|
||||
|
||||
msgQueueSemIdIntern(queueSemId,externId);
|
||||
msgQueueSemIdIntern(queueSemId,externId,queueIdx);
|
||||
queueSemFd=sem_open(queueSemId,O_CREAT|O_EXCL,SEM_DEFAULT_MODE,1);
|
||||
if(queueSemFd==SEM_FAILED){
|
||||
NZG_ERROR("sem_open",queueSemId);
|
||||
|
|
|
@ -1,5 +1,26 @@
|
|||
#include "libnazgul.h"
|
||||
#include "ids.h"
|
||||
|
||||
int queueUnlock(msgSpaceId spaceid,int queueIdx){
|
||||
int queueUnlock(msgSpaceId externId,int queueIdx){
|
||||
sem_t * queueSemFd;
|
||||
msgQueueSemId queueSemId;
|
||||
|
||||
msgQueueSemIdIntern(queueSemId,externId,queueIdx);
|
||||
queueSemFd=sem_open(queueSemId,O_CREAT|O_EXCL,SEM_DEFAULT_MODE,1);
|
||||
if(queueSemFd==SEM_FAILED){
|
||||
NZG_ERROR("sem_open",queueSemId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
if(sem_post(queueSemFd)==-1){
|
||||
NZG_ERROR("sem_post",queueSemId);
|
||||
goto ERROR;
|
||||
}
|
||||
|
||||
sem_close(queueSemFd);
|
||||
|
||||
return 0;
|
||||
ERROR:
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue