Returns true if the number of optional threads has now exceeded the quota.
| 166 | |
| 167 | /// Returns true if the number of optional threads has now exceeded the quota. |
| 168 | bool optional_exceeded() { |
| 169 | // Cache this so optional/required are computed based on the same value. |
| 170 | int64_t num_threads = num_threads_.Load(); |
| 171 | int64_t optional_threads = num_threads >> OPTIONAL_SHIFT; |
| 172 | int64_t required_threads = num_threads & REQUIRED_MASK; |
| 173 | return optional_threads + required_threads > quota(); |
| 174 | } |
| 175 | |
| 176 | /// Returns the number of optional threads that can still be used. |
| 177 | int num_available_threads() const { |
no test coverage detected