kern_lock.c (30813) | kern_lock.c (31016) |
---|---|
1/* 2 * Copyright (c) 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Copyright (C) 1997 6 * John S. Dyson. All rights reserved. 7 * 8 * This code contains ideas from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 * SUCH DAMAGE. 39 * 40 * @(#)kern_lock.c 8.18 (Berkeley) 5/21/95 | 1/* 2 * Copyright (c) 1995 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Copyright (C) 1997 6 * John S. Dyson. All rights reserved. 7 * 8 * This code contains ideas from software contributed to Berkeley by --- 24 unchanged lines hidden (view full) --- 33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 37 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 38 * SUCH DAMAGE. 39 * 40 * @(#)kern_lock.c 8.18 (Berkeley) 5/21/95 |
41 * $Id: kern_lock.c,v 1.12 1997/09/21 04:22:52 dyson Exp $ | 41 * $Id: kern_lock.c,v 1.13 1997/10/28 15:58:19 bde Exp $ |
42 */ 43 44#include <sys/param.h> 45#include <sys/proc.h> 46#include <sys/lock.h> 47#include <sys/systm.h> 48 49/* --- 69 unchanged lines hidden (view full) --- 119 } 120 } 121 return 1; 122} 123 124static int 125acquire(struct lock *lkp, int extflags, int wanted) { 126 int error; | 42 */ 43 44#include <sys/param.h> 45#include <sys/proc.h> 46#include <sys/lock.h> 47#include <sys/systm.h> 48 49/* --- 69 unchanged lines hidden (view full) --- 119 } 120 } 121 return 1; 122} 123 124static int 125acquire(struct lock *lkp, int extflags, int wanted) { 126 int error; |
127 int lock_wait; | |
128 129 if ((extflags & LK_NOWAIT) && (lkp->lk_flags & wanted)) { 130 return EBUSY; 131 } 132 133 if (((lkp->lk_flags | extflags) & LK_NOPAUSE) == 0) { 134 error = apause(lkp, wanted); 135 if (error == 0) --- 238 unchanged lines hidden (view full) --- 374 } 375 simple_unlock(&lkp->lk_interlock); 376 return (error); 377} 378 379static int 380acquiredrain(struct lock *lkp, int extflags) { 381 int error; | 127 128 if ((extflags & LK_NOWAIT) && (lkp->lk_flags & wanted)) { 129 return EBUSY; 130 } 131 132 if (((lkp->lk_flags | extflags) & LK_NOPAUSE) == 0) { 133 error = apause(lkp, wanted); 134 if (error == 0) --- 238 unchanged lines hidden (view full) --- 373 } 374 simple_unlock(&lkp->lk_interlock); 375 return (error); 376} 377 378static int 379acquiredrain(struct lock *lkp, int extflags) { 380 int error; |
382 int lock_wait; | |
383 384 if ((extflags & LK_NOWAIT) && (lkp->lk_flags & LK_ALL)) { 385 return EBUSY; 386 } 387 388 error = apause(lkp, LK_ALL); 389 if (error == 0) 390 return 0; --- 170 unchanged lines hidden --- | 381 382 if ((extflags & LK_NOWAIT) && (lkp->lk_flags & LK_ALL)) { 383 return EBUSY; 384 } 385 386 error = apause(lkp, LK_ALL); 387 if (error == 0) 388 return 0; --- 170 unchanged lines hidden --- |