summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_umtx.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-04-04 02:57:49 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-04-04 02:57:49 +0000
commit31f2b819c68f20ff188724669d3044a0680e3ceb (patch)
tree3cbec5633c5b1de6974d08e11807ee0ce2110a82 /lib/libthr/thread/thr_umtx.c
parent2cacffb02b10bf82a1a5ee4d88c3092821839d16 (diff)
downloadFreeBSD-src-31f2b819c68f20ff188724669d3044a0680e3ceb.zip
FreeBSD-src-31f2b819c68f20ff188724669d3044a0680e3ceb.tar.gz
WARNS level 4 cleanup.
Diffstat (limited to 'lib/libthr/thread/thr_umtx.c')
-rw-r--r--lib/libthr/thread/thr_umtx.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c
index ba73de8..cba6942 100644
--- a/lib/libthr/thread/thr_umtx.c
+++ b/lib/libthr/thread/thr_umtx.c
@@ -33,7 +33,8 @@
int
__thr_umtx_lock(volatile umtx_t *mtx, long id)
{
- while (_umtx_op((struct umtx *)mtx, UMTX_OP_LOCK, id, 0, 0))
+ while (_umtx_op(__DEVOLATILE(struct umtx *, mtx),
+ UMTX_OP_LOCK, id, 0, 0))
;
return (0);
}
@@ -45,8 +46,8 @@ __thr_umtx_timedlock(volatile umtx_t *mtx, long id,
if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 &&
timeout->tv_nsec <= 0)))
return (ETIMEDOUT);
- if (_umtx_op((struct umtx *)mtx, UMTX_OP_LOCK, id, 0,
- (void *)timeout) == 0)
+ if (_umtx_op(__DEVOLATILE(struct umtx *, mtx), UMTX_OP_LOCK, id, 0,
+ __DECONST(void *, timeout)) == 0)
return (0);
return (errno);
}
@@ -54,7 +55,8 @@ __thr_umtx_timedlock(volatile umtx_t *mtx, long id,
int
__thr_umtx_unlock(volatile umtx_t *mtx, long id)
{
- if (_umtx_op((struct umtx *)mtx, UMTX_OP_UNLOCK, id, 0, 0) == 0)
+ if (_umtx_op(__DEVOLATILE(struct umtx *, mtx), UMTX_OP_UNLOCK,
+ id, 0, 0) == 0)
return (0);
return (errno);
}
@@ -65,8 +67,8 @@ _thr_umtx_wait(volatile umtx_t *mtx, long id, const struct timespec *timeout)
if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 &&
timeout->tv_nsec <= 0)))
return (ETIMEDOUT);
- if (_umtx_op((struct umtx *)mtx, UMTX_OP_WAIT, id, 0,
- (void*) timeout) == 0)
+ if (_umtx_op(__DEVOLATILE(struct umtx *, mtx), UMTX_OP_WAIT, id, 0,
+ __DECONST(void*, timeout)) == 0)
return (0);
return (errno);
}
@@ -74,7 +76,8 @@ _thr_umtx_wait(volatile umtx_t *mtx, long id, const struct timespec *timeout)
int
_thr_umtx_wake(volatile umtx_t *mtx, int nr_wakeup)
{
- if (_umtx_op((struct umtx *)mtx, UMTX_OP_WAKE, nr_wakeup, 0, 0) == 0)
+ if (_umtx_op(__DEVOLATILE(struct umtx *, mtx), UMTX_OP_WAKE,
+ nr_wakeup, 0, 0) == 0)
return (0);
return (errno);
}
OpenPOWER on IntegriCloud