summaryrefslogtreecommitdiffstats
path: root/sys/sys/rmlock.h
Commit message (Collapse)AuthorAgeFilesLines
* Add _NEW flag to mtx(9), sx(9), rmlock(9) and rwlock(9).dchagin2014-12-131-0/+1
| | | | | | | | A _NEW flag passed to _init_flags() to avoid check for double-init. Differential Revision: https://reviews.freebsd.org/D1208 Reviewed by: jhb, wblock MFC after: 1 Month
* Several improvements to rmlock(9). Many of these are based on patchesjhb2013-06-251-0/+22
| | | | | | | | | | | | | | | | | | | | | | provided by Isilon. - Add an rm_assert() supporting various lock assertions similar to other locking primitives. Because rmlocks track readers the assertions are always fully accurate unlike rw_assert() and sx_assert(). - Flesh out the lock class methods for rmlocks to support sleeping via condvars and rm_sleep() (but only while holding write locks), rmlock details in 'show lock' in DDB, and the lc_owner method used by dtrace. - Add an internal destroyed cookie so that API functions can assert that an rmlock is not destroyed. - Make use of rm_assert() to add various assertions to the API (e.g. to assert locks are held when an unlock routine is called). - Give RM_SLEEPABLE locks their own lock class and always use the rmlock's own lock_object with WITNESS. - Use THREAD_NO_SLEEPING() / THREAD_SLEEPING_OK() to disallow sleeping while holding a read lock on an rmlock. Submitted by: andre Obtained from: EMC/Isilon
* Replace the TDP_NOSLEEPING flag with a counter so that thejhb2013-03-011-1/+1
| | | | | | THREAD_NO_SLEEPING() and THREAD_SLEEPING_OK() macros can nest. Reviewed by: attilio
* Constify arguments for locking KPIs where possible.pjd2011-11-161-1/+1
| | | | | | | This enables locking consumers to pass their own structures around as const and be able to assert locks embedded into those structures. Reviewed by: ed, kib, jhb
* rmlock(9) two additions and one change/fix:mlaier2010-09-011-8/+14
| | | | | | | | | | | | - add rm_try_rlock(). - add RM_SLEEPABLE to use sx(9) as the back-end lock in order to sleep while holding the write lock. - change rm_noreadtoken to a cpu bitmask to indicate which CPUs need to go through the lock/unlock in order to synchronize. As a side effect, this also avoids IPI to CPUs without any readers during rm_wlock. Discussed with: ups@, rwatson@ on arch@ Sponsored by: Isilon Systems, Inc.
* Make the rmlock(9) interface a bit more like the rwlock(9) interface:rwatson2009-05-291-3/+27
| | | | | | | | | | | | | | - Add rm_init_flags() and accept extended options only for that variation. - Add a flags space specifically for rm_init_flags(), rather than borrowing the lock_init() flag space. - Define flag RM_RECURSE to use instead of LO_RECURSABLE. - Define flag RM_NOWITNESS to allow an rmlock to be exempt from WITNESS checking; this wasn't possible previously as rm_init() always passed LO_WITNESS when initializing an rmlock's struct lock. - Add RM_SYSINIT_FLAGS(). - Rename embedded mutex in rmlocks to make it more obvious what it is. - Update consumers. - Update man page.
* Reduce vertical whitespace and other minor style tweaks.rwatson2009-05-291-15/+2
| | | | Remove unused rm_initialized() macro.
* Add rm_wowned(9) function to test whether the current thread owns anrwatson2007-11-101-0/+1
| | | | | | exclusive lock on the passed rmlock. Reviewed by: ups
* Initial checkin for rmlock (read mostly lock) a multi reader single writerups2007-11-081-0/+109
lock optimized for almost exclusive reader access. (see also rmlock.9) TODO: Convert to per cpu variables linkerset as soon as it is available. Optimize UP (single processor) case.
OpenPOWER on IntegriCloud