Merge Martin Konrad's replace-usleep branch into 3.15

This commit is contained in:
Andrew Johnson
2020-03-20 13:40:35 -05:00
+4 -2
View File
@@ -48,8 +48,10 @@ void epicsAtomicLock ( EpicsAtomicLockKey * )
status = pthread_mutex_lock ( & mutex );
if ( status == 0 ) return;
assert ( status == EINTR );
static const useconds_t retryDelayUSec = 100000;
usleep ( retryDelayUSec );
struct timespec retryDelay = { 0, 100000000 };
struct timespec remainingDelay;
while (nanosleep(&retryDelay, &remainingDelay) == -1 && errno == EINTR)
retryDelay = remainingDelay;
countDown--;
assert ( countDown );
}