| 1290 | } |
| 1291 | |
| 1292 | static bool __always_inline |
| 1293 | _sx_sunlock_try(struct sx *sx, struct thread *td, uintptr_t *xp) |
| 1294 | { |
| 1295 | |
| 1296 | for (;;) { |
| 1297 | if (SX_SHARERS(*xp) > 1 || !(*xp & SX_LOCK_WAITERS)) { |
| 1298 | if (atomic_fcmpset_rel_ptr(&sx->sx_lock, xp, |
| 1299 | *xp - SX_ONE_SHARER)) { |
| 1300 | if (LOCK_LOG_TEST(&sx->lock_object, 0)) |
| 1301 | CTR4(KTR_LOCK, |
| 1302 | "%s: %p succeeded %p -> %p", |
| 1303 | __func__, sx, (void *)*xp, |
| 1304 | (void *)(*xp - SX_ONE_SHARER)); |
| 1305 | td->td_sx_slocks--; |
| 1306 | return (true); |
| 1307 | } |
| 1308 | continue; |
| 1309 | } |
| 1310 | break; |
| 1311 | } |
| 1312 | return (false); |
| 1313 | } |
| 1314 | |
| 1315 | static void __noinline |
| 1316 | _sx_sunlock_hard(struct sx *sx, struct thread *td, uintptr_t x |
no outgoing calls
no test coverage detected