File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -1370,26 +1370,16 @@ throttle(size_t increment)
13701370 if (wait_result & WL_LATCH_SET )
13711371 CHECK_FOR_INTERRUPTS ();
13721372 }
1373- else
1374- {
1375- /*
1376- * The actual transfer rate is below the limit. A negative value
1377- * would distort the adjustment of throttled_last.
1378- */
1379- wait_result = 0 ;
1380- sleep = 0 ;
1381- }
13821373
13831374 /*
1384- * Only a whole multiple of throttling_sample was processed. The rest will
1385- * be done during the next call of this function.
1375+ * As we work with integers, only whole multiple of throttling_sample was
1376+ * processed. The rest will be done during the next call of this function.
13861377 */
13871378 throttling_counter %= throttling_sample ;
13881379
1389- /* Once the (possible) sleep has ended, new period starts. */
1390- if (wait_result & WL_TIMEOUT )
1391- throttled_last += elapsed + sleep ;
1392- else if (sleep > 0 )
1393- /* Sleep was necessary but might have been interrupted. */
1394- throttled_last = GetCurrentIntegerTimestamp ();
1380+ /*
1381+ * Time interval for the remaining amount and possible next increments
1382+ * starts now.
1383+ */
1384+ throttled_last = GetCurrentIntegerTimestamp ();
13951385}
You can’t perform that action at this time.
0 commit comments