In do_sem2_wait(), balance umtx_key_get() with umtx_key_release() on retry.
Reported by: ler Bisected and reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 12 days
This commit is contained in:
parent
ca2cae0b4d
commit
9f7b7da5bf
@ -3316,14 +3316,13 @@ do_sem2_wait(struct thread *td, struct _usem2 *sem, struct _umtx_time *timeout)
|
|||||||
|
|
||||||
uq = td->td_umtxq;
|
uq = td->td_umtxq;
|
||||||
flags = fuword32(&sem->_flags);
|
flags = fuword32(&sem->_flags);
|
||||||
error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key);
|
|
||||||
if (error != 0)
|
|
||||||
return (error);
|
|
||||||
|
|
||||||
if (timeout != NULL)
|
if (timeout != NULL)
|
||||||
abs_timeout_init2(&timo, timeout);
|
abs_timeout_init2(&timo, timeout);
|
||||||
|
|
||||||
again:
|
again:
|
||||||
|
error = umtx_key_get(sem, TYPE_SEM, GET_SHARE(flags), &uq->uq_key);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
umtxq_lock(&uq->uq_key);
|
umtxq_lock(&uq->uq_key);
|
||||||
umtxq_busy(&uq->uq_key);
|
umtxq_busy(&uq->uq_key);
|
||||||
umtxq_insert(uq);
|
umtxq_insert(uq);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user