The Debuginfod server (D114845 + D114846) scans the filesystem for valid binaries, using many threads via ThreadPool. Since the filesystem can hypothetically have very many files, simply submitting all jobs to the ThreadPool without waiting for any to finish processing can cause the queue to use unbounded memory.
This diff adds a small waitQueueSize(size_t Size=0) to the ThreadPool, which blocks until the queue size is at most Size. This allows to keep the total queue size below a constant by waiting whenever it has grown too big.