Commit a60c3757 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Ensure a delay of 5ms in schedule_flush_now.

parent 4064bb60
......@@ -277,7 +277,8 @@ schedule_flush(struct network *net)
void
schedule_flush_now(struct network *net)
{
int msecs = random() % 10;
/* Almost now */
int msecs = 5 + random() % 5;
if(net->flush_time.tv_sec != 0 &&
timeval_minus_msec(&net->flush_time, &now) < msecs)
return;
......
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