| 65 | } |
| 66 | |
| 67 | static __inline void |
| 68 | blockcount_release(blockcount_t *bc, u_int n) |
| 69 | { |
| 70 | u_int old; |
| 71 | |
| 72 | atomic_thread_fence_rel(); |
| 73 | old = atomic_fetchadd_int(&bc->__count, -n); |
| 74 | KASSERT(old >= n, ("%s: counter underflow %p", __func__, bc)); |
| 75 | if (_BLOCKCOUNT_COUNT(old) == n && _BLOCKCOUNT_WAITERS(old)) |
| 76 | _blockcount_wakeup(bc, old); |
| 77 | } |
| 78 | |
| 79 | static __inline void |
| 80 | _blockcount_wait(blockcount_t *bc, struct lock_object *lo, const char *wmesg, |
no test coverage detected