Deleted Added
full compact
kern_mutex.c (69363) kern_mutex.c (69369)
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/kern_mutex.c 69363 2000-11-29 18:41:19Z jhb $
30 * $FreeBSD: head/sys/kern/kern_mutex.c 69369 2000-11-29 20:17:15Z jhb $
31 */
32
33/*
34 * Main Entry: witness
35 * Pronunciation: 'wit-n&s
36 * Function: noun
37 * Etymology: Middle English witnesse, from Old English witnes knowledge,
38 * testimony, witness, from 2wit

--- 277 unchanged lines hidden (view full) ---

316 if (p1)
317 TAILQ_INSERT_BEFORE(p1, p, p_procq);
318 else
319 TAILQ_INSERT_TAIL(&m->mtx_blocked, p,
320 p_procq);
321 }
322
323 p->p_blocked = m; /* Who we're blocked on */
31 */
32
33/*
34 * Main Entry: witness
35 * Pronunciation: 'wit-n&s
36 * Function: noun
37 * Etymology: Middle English witnesse, from Old English witnes knowledge,
38 * testimony, witness, from 2wit

--- 277 unchanged lines hidden (view full) ---

316 if (p1)
317 TAILQ_INSERT_BEFORE(p1, p, p_procq);
318 else
319 TAILQ_INSERT_TAIL(&m->mtx_blocked, p,
320 p_procq);
321 }
322
323 p->p_blocked = m; /* Who we're blocked on */
324 p->p_mtxname = m->mtx_description;
324 p->p_stat = SMTX;
325#if 0
326 propagate_priority(p);
327#endif
328 CTR3(KTR_LOCK, "mtx_enter: p 0x%p blocked on [0x%p] %s",
329 p, m, m->mtx_description);
330 mi_switch();
331 CTR3(KTR_LOCK,

--- 82 unchanged lines hidden (view full) ---

414 pri = cp;
415 }
416 if (pri > p->p_nativepri)
417 pri = p->p_nativepri;
418 SET_PRIO(p, pri);
419 CTR2(KTR_LOCK, "mtx_exit: 0x%p contested setrunqueue 0x%p",
420 m, p1);
421 p1->p_blocked = NULL;
325 p->p_stat = SMTX;
326#if 0
327 propagate_priority(p);
328#endif
329 CTR3(KTR_LOCK, "mtx_enter: p 0x%p blocked on [0x%p] %s",
330 p, m, m->mtx_description);
331 mi_switch();
332 CTR3(KTR_LOCK,

--- 82 unchanged lines hidden (view full) ---

415 pri = cp;
416 }
417 if (pri > p->p_nativepri)
418 pri = p->p_nativepri;
419 SET_PRIO(p, pri);
420 CTR2(KTR_LOCK, "mtx_exit: 0x%p contested setrunqueue 0x%p",
421 m, p1);
422 p1->p_blocked = NULL;
423 p1->p_mtxname = NULL;
422 p1->p_stat = SRUN;
423 setrunqueue(p1);
424 if ((type & MTX_NOSWITCH) == 0 && p1->p_priority < pri) {
425#ifdef notyet
426 if (p->p_flag & (P_ITHD | P_SITHD)) {
427 ithd_t *it = (ithd_t *)p;
428
429 if (it->it_interrupted) {

--- 913 unchanged lines hidden ---
424 p1->p_stat = SRUN;
425 setrunqueue(p1);
426 if ((type & MTX_NOSWITCH) == 0 && p1->p_priority < pri) {
427#ifdef notyet
428 if (p->p_flag & (P_ITHD | P_SITHD)) {
429 ithd_t *it = (ithd_t *)p;
430
431 if (it->it_interrupted) {

--- 913 unchanged lines hidden ---