Acquire a thread for the pool. This will always succeed; the pool will go over the quota if needed. Pools should use this API to reserve threads they need in order to make progress.
| 122 | /// quota if needed. Pools should use this API to reserve threads they need in order to |
| 123 | /// make progress. |
| 124 | void AcquireThreadToken() { |
| 125 | int64_t num_threads = num_threads_.Add(1); |
| 126 | int64_t num_required = num_threads & REQUIRED_MASK; |
| 127 | DCHECK_LE(num_required, max_required_threads_); |
| 128 | } |
| 129 | |
| 130 | /// Try to acquire a thread for this pool. If the pool is at the quota, this will |
| 131 | /// return false and the pool should not run. Pools should use this API for resources |