Cast to uintptr_t to avoid compiler warning, it was broken by
the recent atomic_ptr() change.
This commit is contained in:
parent
e33ed6289e
commit
2ff77b9220
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=148470
@ -47,30 +47,36 @@ _thr_umtx_init(volatile umtx_t *mtx)
|
||||
static inline int
|
||||
_thr_umtx_trylock(volatile umtx_t *mtx, long id)
|
||||
{
|
||||
return umtx_trylock((struct umtx *)mtx, id);
|
||||
if (atomic_cmpset_acq_ptr((volatile uintptr_t *)mtx,
|
||||
(uintptr_t)UMTX_UNOWNED, (uintptr_t)id))
|
||||
return (0);
|
||||
return (EBUSY);
|
||||
}
|
||||
|
||||
static inline int
|
||||
_thr_umtx_lock(volatile umtx_t *mtx, long id)
|
||||
{
|
||||
if (atomic_cmpset_acq_ptr(mtx, (void *)UMTX_UNOWNED, (void *)id))
|
||||
if (atomic_cmpset_acq_ptr((volatile uintptr_t *)mtx,
|
||||
(uintptr_t)UMTX_UNOWNED, (uintptr_t)id))
|
||||
return (0);
|
||||
return __thr_umtx_lock(mtx, id);
|
||||
return (__thr_umtx_lock(mtx, id));
|
||||
}
|
||||
|
||||
static inline int
|
||||
_thr_umtx_timedlock(volatile umtx_t *mtx, long id,
|
||||
const struct timespec *timeout)
|
||||
{
|
||||
if (atomic_cmpset_acq_ptr(mtx, (void *)UMTX_UNOWNED, (void *)id))
|
||||
if (atomic_cmpset_acq_ptr((volatile uintptr_t *)mtx,
|
||||
(uintptr_t)UMTX_UNOWNED, (uintptr_t)id))
|
||||
return (0);
|
||||
return __thr_umtx_timedlock(mtx, id, timeout);
|
||||
return (__thr_umtx_timedlock(mtx, id, timeout));
|
||||
}
|
||||
|
||||
static inline int
|
||||
_thr_umtx_unlock(volatile umtx_t *mtx, long id)
|
||||
{
|
||||
if (atomic_cmpset_rel_ptr(mtx, (void *)id, (void *)UMTX_UNOWNED))
|
||||
if (atomic_cmpset_rel_ptr((volatile uintptr_t *)mtx,
|
||||
(uintptr_t)id, (uintptr_t)UMTX_UNOWNED))
|
||||
return (0);
|
||||
return __thr_umtx_unlock(mtx, id);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user