From 63d82b700dad091f36b4fdf7ac55bfe272a625ba Mon Sep 17 00:00:00 2001 From: pjd Date: Thu, 16 Nov 2006 01:02:00 +0000 Subject: Change sleepq_add(9) argument from 'struct mtx *' to 'struct lock_object *', which allows to use it with different kinds of locks. For example it allows to implement Solaris conditions variables which will be used in ZFS port on top of sx(9) locks. Reviewed by: jhb --- sys/kern/subr_sleepqueue.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sys/kern/subr_sleepqueue.c') diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 081c737..2d79c99 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -120,7 +120,7 @@ struct sleepqueue { void *sq_wchan; /* (c) Wait channel. */ #ifdef INVARIANTS int sq_type; /* (c) Queue type. */ - struct mtx *sq_lock; /* (c) Associated lock. */ + struct lock_object *sq_lock; /* (c) Associated lock. */ #endif }; @@ -262,7 +262,7 @@ sleepq_release(void *wchan) * woken up. */ void -sleepq_add(void *wchan, struct mtx *lock, const char *wmesg, int flags) +sleepq_add(void *wchan, struct lock_object *lock, const char *wmesg, int flags) { struct sleepqueue_chain *sc; struct sleepqueue *sq; @@ -895,7 +895,7 @@ found: #ifdef INVARIANTS db_printf("Queue type: %d\n", sq->sq_type); if (sq->sq_lock) { - lock = &sq->sq_lock->mtx_object; + lock = sq->sq_lock; db_printf("Associated Interlock: %p - (%s) %s\n", lock, LOCK_CLASS(lock)->lc_name, lock->lo_name); } -- cgit v1.1