semBinaryGive, semBinaryTake, semMutexGive, semMutexTake are now macros

This commit is contained in:
Marty Kraimer
2000-10-04 19:34:23 +00:00
parent 01b8b82a94
commit aa769ee715
2 changed files with 17 additions and 25 deletions

View File

@@ -37,18 +37,6 @@ void semBinaryDestroy(semBinaryId id)
semDelete((SEM_ID)id);
}
void semBinaryGive(semBinaryId id)
{
semGive((SEM_ID)id);
}
semTakeStatus semBinaryTake(semBinaryId id)
{
int status;
status = semTake((SEM_ID)id,WAIT_FOREVER);
return((status==OK ? semTakeOK : semTakeError));
}
semTakeStatus semBinaryTakeTimeout(
semBinaryId id, double timeOut)
{
@@ -94,18 +82,6 @@ void semMutexDestroy(semMutexId id)
semDelete((SEM_ID)id);
}
void semMutexGive(semMutexId id)
{
semGive((SEM_ID)id);
}
semTakeStatus semMutexTake(semMutexId id)
{
int status;
status = semTake((SEM_ID)id,WAIT_FOREVER);
return((status==OK ? semTakeOK : semTakeError));
}
semTakeStatus semMutexTakeTimeout(
semMutexId id, double timeOut)
{

View File

@@ -8,4 +8,20 @@ described on the COPYRIGHT_UniversityOfChicago file included as part
of this distribution.
****************************************************************************/
/* no osdSem.h definitions are needed */
#include <vxWorks.h>
#include <semLib.h>
/* If the macro is replaced by inline it is necessary to say
static __inline__
but then a warning message appears everywhere osdSem.h is included
*/
#define semBinaryGive(ID) semGive((SEM_ID)(ID))
#define semBinaryTake(ID) \
(semTake((SEM_ID)(ID),WAIT_FOREVER)==OK ? semTakeOK : semTakeError)
#define semMutexGive(ID) semGive((SEM_ID)(ID))
#define semMutexTake(ID) \
(semTake((SEM_ID)(ID),WAIT_FOREVER)==OK ? semTakeOK : semTakeError)