summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_rwlock.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Replace expanded version of RW_PROC() with the macro.weingart2011-07-051-2/+2
| | | | ok oga@
* Add stricter asserts to DIAGNOSTIC kernels to help catch mutex andmatthew2010-09-241-1/+12
| | | | | | | | | | | | | | | | | rwlock misuse. In particular, this commit makes the following changes: 1. i386 and amd64 now count the number of active mutexes so that assertwaitok(9) can detect attempts to sleep while holding a mutex. 2. i386 and amd64 check that we actually hold mutexes when passed to mtx_leave(). 3. Calls to rw_exit*() now call rw_assert_{rd,wr}lock() as appropriate. ok krw@, oga@; "sounds good to me" deraadt@; assembly bits double checked by pirofti@
* Remove unrelated bit from last commit which breaks at least 2 arches.blambert2009-08-131-8/+1
| | | | Bad blambert@, no biscuit.
* rwlock assertion functions, currently unusedblambert2009-08-131-1/+32
| | | | ok art@
* print lock name in some panic messages so we know what's uptedu2007-05-131-4/+7
| | | | ok krw marco pedro
* Kill a dead variable.art2007-05-041-6/+2
| | | | Pointed out by thib@
* - Rename rw_test_and_set to rw_cas, since most litterature uses theart2007-05-041-12/+27
| | | | | | | | | | | | | | | test_and_set name for some other operation, while cas is generally used for compare and set (cmpxchg in intel land, cas in sparc land). - Make rw locks properly MP safe (provided that rw_cas is implemented in MD code). Most operations were MP safe except the sleep where we could have set the "I'm sleeping" flag before actually going to sleep so that the wakeup could miss us. Now, using the split tsleep, we first setup the sleep (put us on the sleep queues), then set the flag aborting the sleep if the lock has changed and then finally go to sleep. miod@ ok (and he's been prodding me for days to get this in)
* Implement RW_DOWNGRADE that downgrades an exclusive lock to a shared lockart2007-04-041-7/+31
| | | | | | | without letting any other exclusive locks in between. As opposed to upgrading locks, this is easy and solves real problems. deraadt@ ok
* s/completly/completely/mk2006-11-301-2/+2
| | | | ok brad
* remove upgrade/downgrade, they are useless.tedu2006-06-021-73/+33
| | | | | | | rework the main entry points to just use rw_test_and_set. rework exit paths to be more like enter paths. add sleepfail so more lockmgr can be replaced. some from art, ok sturm
* add a name to rwlock so that we can tell where procs are getting stucktedu2006-05-071-3/+4
| | | | | | without breaking into ddb. doubles the size of rwlock [1], but moving forward this really helps. ok/tested pedro fgsch millert krw [1 - next person to add a field to this struct gets whipped with a wet noodle]
* much -> mustpedro2006-04-201-2/+3
|
* oring in PCATCH doesn't help if we don't pass the right prio to tsleeptedu2006-01-061-2/+2
|
* check in of "rwlock.20051230" from art.tedu2006-01-061-115/+145
| | | | | mostly cleanup and simplification, though now also supporting upgrade and downgrade via the magic wand.
* I was wrong. The assymetry created by the proc argument to rw_enter_writeart2004-07-211-3/+5
| | | | | | | | | is horrible and doesn't add anything. Remove it. XXX - the fdplock macro will need a separate cleanup. niklas@ markus@ ok
* don't leave test code enabled, spotted Dries Schellekenstedu2003-11-181-3/+1
|
* add lightwight reader/writer locks from art@. we will be using thesetedu2003-11-181-0/+220
later. have been looked over for quite some time now.