[llvm][Support] Add ExponentialBackoff helper (#81206)
This provides a simple way to implement exponential backoff using a do
while loop.
Usage example (also see the change to LockFileManager.cp
[llvm][Support] Add ExponentialBackoff helper (#81206)
This provides a simple way to implement exponential backoff using a do
while loop.
Usage example (also see the change to LockFileManager.cpp):
```
ExponentialBackoff Backoff(10s);
do {
if (tryToDoSomething())
return ItWorked;
} while (Backoff.waitForNextAttempt());
return Timeout;
```
Abstracting this out of `LockFileManager` as the module build daemon
will need it.
show more ...
|