Date: Mon, 12 Mar 2007 19:56:38 +0100 From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: John Baldwin <jhb@freebsd.org> Cc: Attilio Rao <attilio@freebsd.org>, cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/share/man/man9 Makefile condvar.9 lock.9 mi_switch.9 mtx_pool.9 mutex.9 rwlock.9 sleep.9 sleepqueue.9 sx.9 thread_exit.9 src/sys/kern kern_synch.c src/sys/sys mutex.h rwlock.h sleepqueue.h sx.h systm.h Message-ID: <20070312185638.GA5688@garage.freebsd.pl> In-Reply-To: <200703121116.24667.jhb@freebsd.org> References: <200703092241.l29Mf2Ds062856@repoman.freebsd.org> <3bbf2fe10703100344w1f2464f0q68086a5af7c4f63c@mail.gmail.com> <20070310205236.GA9185@garage.freebsd.pl> <200703121116.24667.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--FCuugMFkClbJLl1L Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Mar 12, 2007 at 11:16:23AM -0400, John Baldwin wrote: > On Saturday 10 March 2007 15:52, Pawel Jakub Dawidek wrote: > > What about something like this: > >=20 > > #define cv_wait(cv, lock) do { > > switch (LO_CLASSINDEX((struct lock_object *)(lock))) { >=20 > The problem with a cast is you use type checking. Might as well do this: >=20 > #define cv_wait(cv, lock) _cv_wait((cv), (struct lock_object *)(lock)) This will skip type checking and my version only cast to provide type checking, so when you pass some random variable it will give you an error. > > PS. I'd really like to be able to use condvar(9) with sx(9) locks, > > because currently I've to manage mu own condvar(9) version for ZFS > > that does exactly this. >=20 > The patch is already done in //depot/jhb/lock/..., just need to settle on= the=20 > API. Ok, good. --=20 Pawel Jakub Dawidek http://www.wheel.pl pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --FCuugMFkClbJLl1L Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (FreeBSD) iD8DBQFF9aJmForvXbEpPzQRAkW7AKCBnAg3YjjeGIne/iow2TAJV32NkQCgphsJ S3+SEb/81cQTv+m4qqT/KJI= =mMT0 -----END PGP SIGNATURE----- --FCuugMFkClbJLl1L--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070312185638.GA5688>