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:
> > 
> > #define     cv_wait(cv, lock)       do {
> >     switch (LO_CLASSINDEX((struct lock_object *)(lock))) {
> 
> The problem with a cast is you use type checking.  Might as well do this:
> 
> #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.
> 
> The patch is already done in //depot/jhb/lock/..., just need to settle on the 
> API.

Ok, good.

-- 
Pawel Jakub Dawidek                       http://www.wheel.pl
[EMAIL PROTECTED]                           http://www.FreeBSD.org
FreeBSD committer                         Am I Evil? Yes, I Am!

Attachment: pgpMvzJqnUL5D.pgp
Description: PGP signature

Reply via email to