| 127 | */ |
| 128 | #endif |
| 129 | static __inline __result_use_check bool |
| 130 | refcount_acquire_if_gt(volatile u_int *count, u_int n) |
| 131 | { |
| 132 | u_int old; |
| 133 | |
| 134 | old = atomic_load_int(count); |
| 135 | for (;;) { |
| 136 | if (old <= n) |
| 137 | return (false); |
| 138 | if (__predict_false(REFCOUNT_SATURATED(old))) |
| 139 | return (true); |
| 140 | if (atomic_fcmpset_int(count, &old, old + 1)) |
| 141 | return (true); |
| 142 | } |
| 143 | } |
| 144 | |
| 145 | static __inline __result_use_check bool |
| 146 | refcount_acquire_if_not_zero(volatile u_int *count) |
no outgoing calls
no test coverage detected