This is Unofficial EPICS BASE Doxygen Site
osdMutex.c
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2002 The University of Chicago, as Operator of Argonne
3 * National Laboratory.
4 * Copyright (c) 2002 The Regents of the University of California, as
5 * Operator of Los Alamos National Laboratory.
6 * EPICS BASE Versions 3.13.7
7 * and higher are distributed subject to a Software License Agreement found
8 * in file LICENSE that is included with this distribution.
9 \*************************************************************************/
10 /* os/vxWorks/osdMutex.c */
11 
12 /* Author: Marty Kraimer Date: 25AUG99 */
13 
14 #include <vxWorks.h>
15 #include <semLib.h>
16 #include <time.h>
17 #include <objLib.h>
18 #include <sysLib.h>
19 
20 /* The following not defined in an vxWorks header */
21 int sysClkRateGet(void);
22 
23 
24 #include "epicsMutex.h"
25 
27 {
28  return((struct epicsMutexOSD *)
29  semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY));
30 }
31 
33 {
34  semDelete((SEM_ID)id);
35 }
36 
38 {
39  int status;
40  status = semTake((SEM_ID)id,NO_WAIT);
41  if(status==OK) return(epicsMutexLockOK);
42  if(errno==S_objLib_OBJ_UNAVAILABLE) return(epicsMutexLockTimeout);
43  return(epicsMutexLockError);
44 }
45 
46 void epicsMutexOsdShow(struct epicsMutexOSD * id,unsigned int level)
47 {
48  semShow((SEM_ID)id,level);
49 }
pvd::Status status
int sysClkRateGet(void)
epicsMutexOSD * epicsMutexOsdCreate(void)
Definition: osdMutex.c:175
APIs for the epicsMutex mutual exclusion semaphore.
epicsMutexLockStatus epicsMutexOsdTryLock(struct epicsMutexOSD *pmutex)
Definition: osdMutex.c:301
epicsMutexLockStatus
Definition: epicsMutex.h:51
void epicsMutexOsdDestroy(struct epicsMutexOSD *pmutex)
Definition: osdMutex.c:221
void epicsMutexOsdShow(struct epicsMutexOSD *pmutex, unsigned int level)
Definition: osdMutex.c:329