| 157 | } |
| 158 | } |
| 159 | int pending(Handle h) { |
| 160 | if (h.is_large_) { |
| 161 | LargeCounts c = Large(h)->load(std::memory_order_relaxed); |
| 162 | if (PENDING_NOTREADY == NodeStateForStruct(c)) { |
| 163 | return c.pending; |
| 164 | } else { |
| 165 | // The pending count encodes the state once the node has |
| 166 | // started, so just return 0. |
| 167 | return 0; |
| 168 | } |
| 169 | } else { |
| 170 | PackedCounts c = Packed(h)->load(std::memory_order_relaxed); |
| 171 | if (PENDING_NOTREADY == NodeStateForStruct(c)) { |
| 172 | return c.pending; |
| 173 | } else { |
| 174 | // The pending count encodes the state once the node has |
| 175 | // started, so just return 0. |
| 176 | return 0; |
| 177 | } |
| 178 | } |
| 179 | } |
| 180 | int decrement_pending(Handle h, int v) { |
| 181 | DCHECK_GE(pending(h), v); |
| 182 | if (h.is_large_) { |