Correct nanosleep usage

This commit is contained in:
Jack Andersen 2019-02-23 21:14:27 -10:00
parent e75735d246
commit f8b22ecb13
1 changed files with 1 additions and 4 deletions

View File

@ -1253,10 +1253,7 @@ public:
} else if (comp > 0) {
/* Not at due date yet, sleep here */
struct timespec wait_time = timespec_sub(m_lastWaitTime, tp);
nanosleep(&wait_time, nullptr);
do {
clock_gettime(CLOCK_REALTIME, &tp);
} while (timespec_compare(m_lastWaitTime, tp) > 0);
while (nanosleep(&wait_time, &wait_time)) {}
return 1;
} else {
/* Missed due date, assign next one and return passed cycle count */