diff options
author | Juli Mallett <jmallett@FreeBSD.org> | 2010-11-08 22:12:25 +0000 |
---|---|---|
committer | Juli Mallett <jmallett@FreeBSD.org> | 2010-11-08 22:12:25 +0000 |
commit | b79b28b69d1a289f861e72edf883ed8a1391ce9c (patch) | |
tree | 7f8a6ae64954f6c62670e4d9b3a53f9b7e2920bc /sys/kern/subr_taskqueue.c | |
parent | 45b8980f0e6cb38b285365e2cfdbccc99cf3b9a8 (diff) | |
download | src-b79b28b69d1a289f861e72edf883ed8a1391ce9c.tar.gz src-b79b28b69d1a289f861e72edf883ed8a1391ce9c.zip |
Notes
Diffstat (limited to 'sys/kern/subr_taskqueue.c')
-rw-r--r-- | sys/kern/subr_taskqueue.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/sys/kern/subr_taskqueue.c b/sys/kern/subr_taskqueue.c index d31d668a4242..49ddce2e05eb 100644 --- a/sys/kern/subr_taskqueue.c +++ b/sys/kern/subr_taskqueue.c @@ -68,23 +68,21 @@ struct taskqueue { #define TQ_FLAGS_BLOCKED (1 << 1) #define TQ_FLAGS_PENDING (1 << 2) -static __inline void -TQ_LOCK(struct taskqueue *tq) -{ - if (tq->tq_spin) - mtx_lock_spin(&tq->tq_mutex); - else - mtx_lock(&tq->tq_mutex); -} - -static __inline void -TQ_UNLOCK(struct taskqueue *tq) -{ - if (tq->tq_spin) - mtx_unlock_spin(&tq->tq_mutex); - else - mtx_unlock(&tq->tq_mutex); -} +#define TQ_LOCK(tq) \ + do { \ + if ((tq)->tq_spin) \ + mtx_lock_spin(&(tq)->tq_mutex); \ + else \ + mtx_lock(&(tq)->tq_mutex); \ + } while (0) + +#define TQ_UNLOCK(tq) \ + do { \ + if ((tq)->tq_spin) \ + mtx_unlock_spin(&(tq)->tq_mutex); \ + else \ + mtx_unlock(&(tq)->tq_mutex); \ + } while (0) static __inline int TQ_SLEEP(struct taskqueue *tq, void *p, struct mtx *m, int pri, const char *wm, |