diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-07 02:44:11 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2001-11-07 02:44:11 +0000 |
commit | 253f31ab10d5b90c1d64de9c7dec0385fa0c9f7c (patch) | |
tree | 7061e710b11135872748c890aa0fe46e112bb579 /sys/kern/kern_lock.c | |
parent | 30a2a19888ac909856240fe388c19aa040d607f2 (diff) |
new flag to lockmgr. LK_RECURSEFAIL - even if the lock can recurse fail.
Diffstat (limited to 'sys/kern/kern_lock.c')
-rw-r--r-- | sys/kern/kern_lock.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index a40ee24d847..1da1663f8d0 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.9 1999/07/09 15:17:59 art Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.10 2001/11/07 02:44:10 art Exp $ */ /* * Copyright (c) 1995 @@ -318,8 +318,13 @@ lockmgr(lkp, flags, interlkp, p) /* * Recursive lock. */ - if ((extflags & LK_CANRECURSE) == 0) + if ((extflags & LK_CANRECURSE) == 0) { + if (extflags & LK_RECURSEFAIL) { + error = EDEADLK; + break; + } panic("lockmgr: locking against myself"); + } lkp->lk_exclusivecount++; COUNT(p, 1); break; |