File tree 1 file changed +7
-17
lines changed
1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -1303,26 +1303,16 @@ throttle(size_t increment)
1303
1303
if (wait_result & WL_LATCH_SET )
1304
1304
CHECK_FOR_INTERRUPTS ();
1305
1305
}
1306
- else
1307
- {
1308
- /*
1309
- * The actual transfer rate is below the limit. A negative value
1310
- * would distort the adjustment of throttled_last.
1311
- */
1312
- wait_result = 0 ;
1313
- sleep = 0 ;
1314
- }
1315
1306
1316
1307
/*
1317
- * Only a whole multiple of throttling_sample was processed. The rest will
1318
- * be done during the next call of this function.
1308
+ * As we work with integers, only whole multiple of throttling_sample was
1309
+ * processed. The rest will be done during the next call of this function.
1319
1310
*/
1320
1311
throttling_counter %= throttling_sample ;
1321
1312
1322
- /* Once the (possible) sleep has ended, new period starts. */
1323
- if (wait_result & WL_TIMEOUT )
1324
- throttled_last += elapsed + sleep ;
1325
- else if (sleep > 0 )
1326
- /* Sleep was necessary but might have been interrupted. */
1327
- throttled_last = GetCurrentIntegerTimestamp ();
1313
+ /*
1314
+ * Time interval for the remaining amount and possible next increments
1315
+ * starts now.
1316
+ */
1317
+ throttled_last = GetCurrentIntegerTimestamp ();
1328
1318
}
You can’t perform that action at this time.
0 commit comments