Insert read memory barriers.
This commit is contained in:
parent
b77656256d
commit
8c9cfa24de
@ -434,7 +434,7 @@ _libc_sem_post_compat(sem_t *sem)
|
||||
return ksem_post((*sem)->semid);
|
||||
|
||||
atomic_add_rel_int(&(*sem)->count, 1);
|
||||
|
||||
rmb();
|
||||
if ((*sem)->nwaiters)
|
||||
return _umtx_wake(&(*sem)->count);
|
||||
return (0);
|
||||
|
@ -332,6 +332,7 @@ _sem_getvalue(sem_t * __restrict sem, int * __restrict sval)
|
||||
static __inline int
|
||||
usem_wake(struct _usem *sem)
|
||||
{
|
||||
rmb();
|
||||
if (!sem->_has_waiters)
|
||||
return (0);
|
||||
return _umtx_op(sem, UMTX_OP_SEM_WAKE, 0, NULL, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user