diff options
author | davidxu <davidxu@FreeBSD.org> | 2007-11-21 05:21:58 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2007-11-21 05:21:58 +0000 |
commit | c63688968a333b863524a975289bc95c25685608 (patch) | |
tree | bd92b4c6d4241b908fcaf1640e5cc6e419dc109b /lib/libthr/thread/thr_sem.c | |
parent | 648833c9531994ca86ff55eaabdde1c3f8b9e6d0 (diff) | |
download | FreeBSD-src-c63688968a333b863524a975289bc95c25685608.zip FreeBSD-src-c63688968a333b863524a975289bc95c25685608.tar.gz |
Remove umtx_t definition, use type long directly, add wrapper function
_thr_umtx_wait_uint() for umtx operation UMTX_OP_WAIT_UINT, use the
function in semaphore operations, this fixed compiler warnings.
Diffstat (limited to 'lib/libthr/thread/thr_sem.c')
-rw-r--r-- | lib/libthr/thread/thr_sem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libthr/thread/thr_sem.c b/lib/libthr/thread/thr_sem.c index 6dbf7f4..01557f3 100644 --- a/lib/libthr/thread/thr_sem.c +++ b/lib/libthr/thread/thr_sem.c @@ -196,7 +196,7 @@ _sem_wait(sem_t *sem) return (0); } _thr_cancel_enter(curthread); - retval = _thr_umtx_wait((umtx_t *)&(*sem)->count, 0, NULL); + retval = _thr_umtx_wait_uint(&(*sem)->count, 0, NULL); _thr_cancel_leave(curthread); } while (retval == 0); errno = retval; @@ -239,7 +239,7 @@ _sem_timedwait(sem_t * __restrict sem, clock_gettime(CLOCK_REALTIME, &ts); TIMESPEC_SUB(&ts2, abstime, &ts); _thr_cancel_enter(curthread); - retval = _thr_umtx_wait((umtx_t *)&(*sem)->count, 0, &ts2); + retval = _thr_umtx_wait_uint(&(*sem)->count, 0, &ts2); _thr_cancel_leave(curthread); } while (retval == 0); errno = retval; @@ -264,7 +264,7 @@ _sem_post(sem_t *sem) do { val = (*sem)->count; } while (!atomic_cmpset_acq_int(&(*sem)->count, val, val + 1)); - retval = _thr_umtx_wake((umtx_t *)&(*sem)->count, val + 1); + retval = _thr_umtx_wake(&(*sem)->count, val + 1); if (retval > 0) retval = 0; return (retval); |