Insert read memory barriers.

This commit is contained in:
David Xu 2012-01-16 06:15:14 +00:00
parent b834944105
commit d22d46ce27
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=230201
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -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);