| 129 | |
| 130 | |
| 131 | const Duration ReaperProcess::interval() |
| 132 | { |
| 133 | size_t count = promises.size(); |
| 134 | |
| 135 | if (count <= LOW_PID_COUNT) { |
| 136 | return MIN_REAP_INTERVAL(); |
| 137 | } else if (count >= HIGH_PID_COUNT) { |
| 138 | return MAX_REAP_INTERVAL(); |
| 139 | } |
| 140 | |
| 141 | // Linear interpolation between min and max reap intervals. |
| 142 | double fraction = |
| 143 | ((double) (count - LOW_PID_COUNT) / (HIGH_PID_COUNT - LOW_PID_COUNT)); |
| 144 | |
| 145 | return (MIN_REAP_INTERVAL() + |
| 146 | (MAX_REAP_INTERVAL() - MIN_REAP_INTERVAL()) * fraction); |
| 147 | } |
| 148 | |
| 149 | } // namespace internal { |
| 150 |
nothing calls this directly
no test coverage detected