Changeset View
Changeset View
Standalone View
Standalone View
sys/kern/kern_umtx.c
Show First 20 Lines • Show All 543 Lines • ▼ Show 20 Lines | if (smp_cpus > 1) { | ||||
while (uc->uc_busy && --count > 0) | while (uc->uc_busy && --count > 0) | ||||
cpu_spinwait(); | cpu_spinwait(); | ||||
umtxq_lock(key); | umtxq_lock(key); | ||||
} | } | ||||
} | } | ||||
#endif | #endif | ||||
while (uc->uc_busy) { | while (uc->uc_busy) { | ||||
uc->uc_waiters++; | uc->uc_waiters++; | ||||
msleep(uc, &uc->uc_lock, 0, "umtxqb", 0); | msleep(uc, &uc->uc_lock, PUSERW, "umtxqb", 0); | ||||
uc->uc_waiters--; | uc->uc_waiters--; | ||||
} | } | ||||
} | } | ||||
uc->uc_busy = 1; | uc->uc_busy = 1; | ||||
} | } | ||||
/* | /* | ||||
* Unbusy a chain. | * Unbusy a chain. | ||||
▲ Show 20 Lines • Show All 269 Lines • ▼ Show 20 Lines | for (;;) { | ||||
if (abstime != NULL) { | if (abstime != NULL) { | ||||
timo = abs_timeout_gethz(abstime); | timo = abs_timeout_gethz(abstime); | ||||
if (timo < 0) { | if (timo < 0) { | ||||
error = ETIMEDOUT; | error = ETIMEDOUT; | ||||
break; | break; | ||||
} | } | ||||
} else | } else | ||||
timo = 0; | timo = 0; | ||||
error = msleep(uq, &uc->uc_lock, PCATCH | PDROP, wmesg, timo); | error = msleep(uq, &uc->uc_lock, PCATCH | PDROP | PUSERW, | ||||
wmesg, timo); | |||||
if (error == EINTR || error == ERESTART) { | if (error == EINTR || error == ERESTART) { | ||||
umtxq_lock(&uq->uq_key); | umtxq_lock(&uq->uq_key); | ||||
break; | break; | ||||
} | } | ||||
if (abstime != NULL) { | if (abstime != NULL) { | ||||
if (abstime->is_abs_real) | if (abstime->is_abs_real) | ||||
curthread->td_rtcgen = | curthread->td_rtcgen = | ||||
atomic_load_acq_int(&rtc_generation); | atomic_load_acq_int(&rtc_generation); | ||||
▲ Show 20 Lines • Show All 3,827 Lines • Show Last 20 Lines |