mirror of https://github.com/AxioDL/boo.git
Correct nanosleep usage
This commit is contained in:
parent
e75735d246
commit
f8b22ecb13
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue