Subject: CVS commit: src
To: None <source-changes@netbsd.org>
From: Frank van der Linden <fvdl@netbsd.org>
List: source-changes
Date: 02/28/1999 06:09:15
Module Name:	src
Committed By:	fvdl
Date:		Sun Feb 28 14:09:15 UTC 1999

Modified Files:
	src/sys/kern: kern_lock.c
Log Message:
Recursive locks were previously only available with LK_CANRECURSE. This
could be done in one of 2 ways:

* call lk_init with LK_CANRECURSE, resulting in a lock that
always can be used recursively.
* call lockmgr with LK_CANRECURSE, meaning that it's ok if this
lock is already held by us.

Sometimes we need a locking type that says: take this lock now, exclusively,
but while I am holding it, I may go through a code path which could attempt
to get the lock again, and which is unaware that the lock might already
be taken.  Implement LK_SETRECURSE for this purpose. Assume that locks and
unlocks come in matching pairs (they should), and check for this 'level'
using SETRECURSE locks.