Commit 10ccc150 authored by Andreas Schmidt's avatar Andreas Schmidt

Redo.

parent 5c5ca228
Pipeline #2819 passed with stages
in 1 minute and 40 seconds
......@@ -52,20 +52,20 @@ bool PrrtSocket_pace(PrrtSocket *s, bool prepace) {
PrrtPace_track_pause(s->prrtTransmitPace);
if (s->pacingEnabled && s->nextSendTime != 0) {
debug(DEBUG_DATATRANSMITTER, "About to check for pacing.");
prrtTimeDiff_t diff = 0;
prrtTimeDifference_t diff = 0;
do {
if(PrrtSocket_closing(s)) {
result = false;
break;
}
prrtTimeDiff_t now = (prrtTimeDiff_t) PrrtClock_get_current_time_us();
diff = ((prrtTimeDiff_t) s->nextSendTime) - now;
prrtTimeDifference_t now = (prrtTimeDifference_t) PrrtClock_get_current_time_us();
diff = ((prrtTimeDifference_t) s->nextSendTime) - now;
if (!prepace) { // post-pacing removes appSendPace
diff -= PrrtPace_get_diff(s->appSendPace);
diff = MAX(0, diff);
}
if (diff > 0) {
usleep_nano(diff);
usleep_nano((uint32_t) diff);
}
} while (diff > 0);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment