Fires a message to self for the next event. This also cancels any existing timer.
| 166 | // Fires a message to self for the next event. This also cancels any |
| 167 | // existing timer. |
| 168 | void GarbageCollectorProcess::reset() |
| 169 | { |
| 170 | Clock::cancel(timer); // Cancel the existing timer, if any. |
| 171 | if (!paths.empty()) { |
| 172 | Timeout removalTime = (*paths.begin()).first; // Get the first entry. |
| 173 | |
| 174 | timer = delay(removalTime.remaining(), self(), &Self::remove, removalTime); |
| 175 | } else { |
| 176 | timer = Timer(); // Reset the timer. |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | |
| 181 | void GarbageCollectorProcess::remove(const Timeout& removalTime) |