* Signal sleeping waiters after the counter has reached zero. */
| 389 | * Signal sleeping waiters after the counter has reached zero. |
| 390 | */ |
| 391 | void |
| 392 | _blockcount_wakeup(blockcount_t *bc, u_int old) |
| 393 | { |
| 394 | |
| 395 | KASSERT(_BLOCKCOUNT_WAITERS(old), |
| 396 | ("%s: no waiters on %p", __func__, bc)); |
| 397 | |
| 398 | if (atomic_cmpset_int(&bc->__count, _BLOCKCOUNT_WAITERS_FLAG, 0)) |
| 399 | wakeup(bc); |
| 400 | } |
| 401 | |
| 402 | /* |
| 403 | * Wait for a wakeup or a signal. This does not guarantee that the count is |
no test coverage detected