Files
clang-p2996/llvm/lib/Support/ExponentialBackoff.cpp
Michael Spencer edff3ff4d3 [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.
2024-02-13 18:35:39 -08:00

1.1 KiB