KiCad PCB EDA Suite
Loading...
Searching...
No Matches
file_in_use_backoff.h File Reference
#include <algorithm>
#include <chrono>
#include <random>

Go to the source code of this file.

Functions

std::chrono::milliseconds FileInUseBackoff (int aAttempt, std::minstd_rand &aRng)
 

Function Documentation

◆ FileInUseBackoff()

std::chrono::milliseconds FileInUseBackoff ( int aAttempt,
std::minstd_rand & aRng )
inline
Returns
the wait before retrying an open that found the file in use. Instances opening one file together hold it for milliseconds, so the window starts at 100 ms and doubles up to 1.6 s, and the wait is drawn from its upper half so that readers that failed together do not all come back together.

Definition at line 32 of file file_in_use_backoff.h.

Referenced by SCH_IO_DATABASE::connect(), and ACE_BACKEND::freshSession().