Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2008 12:02:56 -0400
From:      "Ryan Stone" <rysto32@gmail.com>
To:        freebsd-hackers@freebsd.org
Cc:        Max Laier <max@love2party.net>
Subject:   Re: Acquiring a mtx after an sx lock
Message-ID:  <bc2d970808180902h1ded9bcbp494d276ede0eeed@mail.gmail.com>
In-Reply-To: <200808181754.18812.max@love2party.net>
References:  <bc2d970808180814ue926d43s7966b36ffa3c9699@mail.gmail.com> <200808181754.18812.max@love2party.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I guess the FreeBSD 8 man pages have been fixed but the FreeBSD 7 ones
haven't.  This is what I was looking at:

http://www.freebsd.org/cgi/man.cgi?query=locking&apropos=0&sektion=0&manpath=FreeBSD+7.0-RELEASE&format=html

Thanks for the response,
Ryan Stone

On Mon, Aug 18, 2008 at 11:54 AM, Max Laier <max@love2party.net> wrote:

> On Monday 18 August 2008 17:14:01 Ryan Stone wrote:
> > Are there any problems acquiring a sleep mutex after acquiring an sx
> lock?
> > man 9 locking says that you can't, but doesn't provide any reasons.
> > Obviously while you're holding the mutex you have to abide by the rules
> > applying to mutexes, but as long as you do that, I can't see why
> acquiring
> > a mutex after an sx lock would cause an issue.  Is the locking man page
> > wrong about this?
>
> Where does it say so?  The interaction table clearly shows:
>
>      You have: You want:  Spin_mtx  Slp_mtx sx_lock rw_lock rm_locksleep
>      SPIN mutex           ok-1      no      no      no      no    no-3
>      Sleep mutex          ok        ok-1    no      ok      ok    no-3
>                                      |
>                                      V
>      sx_lock              ok     -->ok<--   ok-2    ok      ok    ok-4
>                                      ^
>                                      |
>      rw_lock              ok        ok      no      ok-2    ok    no-3
>      rm_lock              ok        ok      no      ok      ok-2  no
>
>
> --
> /"\  Best regards,                      | mlaier@freebsd.org
> \ /  Max Laier                          | ICQ #67774661
>  X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
> / \  ASCII Ribbon Campaign              | Against HTML Mail and News
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bc2d970808180902h1ded9bcbp494d276ede0eeed>