Bug 75587

Summary: Re: man page for sx(9) is misleading
Product: Documentation Reporter: Giorgos Keramidas <keramida>
Component: Books & ArticlesAssignee: GNATS administrator <gnats-admin>
Status: Closed FIXED    
Severity: Affects Only Me CC: bug-followup
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Giorgos Keramidas 2004-12-28 23:40:20 UTC
 On 2004-12-28 13:55, Darren Reed <darrenr@FreeBSD.ORG> wrote:
 >
 > According to discussion on freebsd mailing lists, it is not possible
 > to hold an sx lock when you want a mtx lock.  This should be documented.
 
 As far as I can tell, by looking at kern_sx.c and sys/sx.h, this is
 because the sx lock initialization uses an mtxpool for the mutex used to
 serialize access to the internal sx lock data.
 
 Leaf locks may be used in operations that msleep() but there can be only
 one of them in each lock path and no other lock can be obtained after
 them.
 
 This is sort of implied by the SEE ALSO reference of mtx_pool(9), but we
 should probably state it explicitly in CONTEXT.
 
 %%%
 Index: sx.9
 ===================================================================
 RCS file: /home/ncvs/src/share/man/man9/sx.9,v
 retrieving revision 1.29
 diff -u -r1.29 sx.9
 --- sx.9        11 Jul 2004 16:08:25 -0000      1.29
 +++ sx.9        28 Dec 2004 23:28:22 -0000
 @@ -196,6 +196,11 @@
  A thread may hold a shared or exclusive lock on an
  .Nm
  lock while sleeping.
 +The
 +.Nm
 +locks are implemented using
 +.Xr mtxpool 9
 +shared leaf locks, so they should always be the last lock obtained.
  .Sh SEE ALSO
  .Xr condvar 9 ,
  .Xr mtx_pool 9 ,
 %%%
Comment 1 Giorgos Keramidas freebsd_committer freebsd_triage 2004-12-29 08:32:28 UTC
State Changed
From-To: open->closed

Followup to docs/75571, misfiled as a new PR.