Commit Graph

9 Commits

Author SHA1 Message Date
John Baldwin
e7573e7ad7 Allow threads to atomically release rw and sx locks while waiting for an
event.  Locking primitives that support this (mtx, rw, and sx) now each
include their own foo_sleep() routine.
- Rename msleep() to _sleep() and change it's 'struct mtx' object to a
  'struct lock_object' pointer.  _sleep() uses the recently added
  lc_unlock() and lc_lock() function pointers for the lock class of the
  specified lock to release the lock while the thread is suspended.
- Add wrappers around _sleep() for mutexes (mtx_sleep()), rw locks
  (rw_sleep()), and sx locks (sx_sleep()).  msleep() still exists and
  is now identical to mtx_sleep(), but it is deprecated.
- Rename SLEEPQ_MSLEEP to SLEEPQ_SLEEP.
- Rewrite much of sleep.9 to not be msleep(9) centric.
- Flesh out the 'RETURN VALUES' section in sleep.9 and add an 'ERRORS'
  section.
- Add __nonnull(1) to _sleep() and msleep_spin() so that the compiler will
  warn if you try to pass a NULL wait channel.  The functions already have
  a KASSERT to that effect.
2007-03-09 22:41:01 +00:00
John Baldwin
b58aa2bde7 Place mtx_destroy() and rw_destroy() right after mtx_init() and rw_init()
to match sx(9) and condvar(9).
2007-03-09 16:54:03 +00:00
John Baldwin
7d3052bbc4 - Sort rwlock functions similar to the order in mutex(9).
- Add a missing MLINK.
2007-03-09 16:44:58 +00:00
Robert Watson
dd348217d7 Update rwlock(9) for rw_wowned(). 2007-02-26 19:07:41 +00:00
Ruslan Ermilov
bd84dd2f8f Revise markup. 2006-09-30 17:09:59 +00:00
Florent Thoumie
f1acac210b Fix typo (s/writeer/writer/). 2006-07-17 10:39:20 +00:00
John Baldwin
96cb5f9912 Document rw_try_upgrade() and rw_downgrade(). 2006-04-19 21:09:17 +00:00
John Baldwin
0b79fedb9b Various nits and fixups so that the text reads smoother in several places.
Also, more closely match the prototypes in sys/rwlock.h and add a BUGS
section.
2006-04-19 20:43:35 +00:00
Gleb Smirnoff
3182fc7b3e Document read/write locks.
Reviewed by:	jhb, ru
2006-02-01 19:39:25 +00:00