This is Unofficial EPICS BASE Doxygen Site
epicsAtomicOSD.h File Reference
#include "libComAPI.h"
#include "epicsAtomicDefault.h"
+ Include dependency graph for epicsAtomicOSD.h:

Go to the source code of this file.

Classes

struct  EpicsAtomicLockKey
 

Macros

#define EPICS_ATOMIC_OS_NAME   "Solaris"
 

Typedefs

typedef struct EpicsAtomicLockKey EpicsAtomicLockKey
 

Functions

LIBCOM_API void epicsAtomicLock (struct EpicsAtomicLockKey *)
 
LIBCOM_API void epicsAtomicUnlock (struct EpicsAtomicLockKey *)
 

Macro Definition Documentation

#define EPICS_ATOMIC_OS_NAME   "Solaris"

Definition at line 21 of file epicsAtomicOSD.h.

Typedef Documentation

Function Documentation

LIBCOM_API void epicsAtomicLock ( struct EpicsAtomicLockKey )

Definition at line 42 of file epicsAtomicOSD.cpp.

43 {
44  unsigned countDown = 1000u;
45  int status;
46  while ( true ) {
47  status = pthread_mutex_lock ( & mutex );
48  if ( status == 0 ) return;
49  assert ( status == EINTR );
50  struct timespec retryDelay = { 0, 100000000 };
51  struct timespec remainingDelay;
52  while (nanosleep(&retryDelay, &remainingDelay) == -1 && errno == EINTR)
53  retryDelay = remainingDelay;
54  countDown--;
55  assert ( countDown );
56  }
57 }
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
pvd::Status status
Defined by POSIX Real Time.
Definition: osdTime.h:21
LIBCOM_API void epicsAtomicUnlock ( struct EpicsAtomicLockKey )

Definition at line 59 of file epicsAtomicOSD.cpp.

60 {
61  const int status = pthread_mutex_unlock ( & mutex );
62  assert ( status == 0 );
63 }
#define assert(exp)
Declare that a condition should be true.
Definition: epicsAssert.h:70
pvd::Status status