subr_witness.c (93273) | subr_witness.c (93676) |
---|---|
1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ | 1/*- 2 * Copyright (c) 1998 Berkeley Software Design, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 1. Redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer. --- 13 unchanged lines hidden (view full) --- 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * 28 * from BSDI $Id: mutex_witness.c,v 1.1.2.20 2000/04/27 03:10:27 cp Exp $ 29 * and BSDI $Id: synch_machdep.c,v 2.3.2.39 2000/04/27 03:10:25 cp Exp $ |
30 * $FreeBSD: head/sys/kern/subr_witness.c 93273 2002-03-27 09:23:41Z jeff $ | 30 * $FreeBSD: head/sys/kern/subr_witness.c 93676 2002-04-02 16:51:20Z jhb $ |
31 */ 32 33/* 34 * Implementation of the `witness' lock verifier. Originally implemented for 35 * mutexes in BSD/OS. Extended to handle generic lock objects and lock 36 * classes in FreeBSD. 37 */ 38 --- 430 unchanged lines hidden (view full) --- 469 if (witness_cold || witness_dead || lock->lo_witness == NULL || 470 panicstr != NULL) 471 return; 472 w = lock->lo_witness; 473 class = lock->lo_class; 474 td = curthread; 475 476 if (class->lc_flags & LC_SLEEPLOCK) { | 31 */ 32 33/* 34 * Implementation of the `witness' lock verifier. Originally implemented for 35 * mutexes in BSD/OS. Extended to handle generic lock objects and lock 36 * classes in FreeBSD. 37 */ 38 --- 430 unchanged lines hidden (view full) --- 469 if (witness_cold || witness_dead || lock->lo_witness == NULL || 470 panicstr != NULL) 471 return; 472 w = lock->lo_witness; 473 class = lock->lo_class; 474 td = curthread; 475 476 if (class->lc_flags & LC_SLEEPLOCK) { |
477 /* 478 * Since spin locks include a critical section, this check 479 * impliclty enforces a lock order of all sleep locks before 480 * all spin locks. 481 */ |
|
477 if (td->td_critnest != 0 && (flags & LOP_TRYLOCK) == 0) 478 panic("blockable sleep lock (%s) %s @ %s:%d", 479 class->lc_name, lock->lo_name, file, line); 480 lock_list = &td->td_sleeplocks; 481 } else 482 lock_list = PCPU_PTR(spinlocks); 483 484 /* --- 985 unchanged lines hidden --- | 482 if (td->td_critnest != 0 && (flags & LOP_TRYLOCK) == 0) 483 panic("blockable sleep lock (%s) %s @ %s:%d", 484 class->lc_name, lock->lo_name, file, line); 485 lock_list = &td->td_sleeplocks; 486 } else 487 lock_list = PCPU_PTR(spinlocks); 488 489 /* --- 985 unchanged lines hidden --- |