Deleted Added
full compact
subr_turnstile.c (112513) subr_turnstile.c (113339)
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_turnstile.c 112513 2003-03-23 11:26:11Z tjr $
30 * $FreeBSD: head/sys/kern/subr_turnstile.c 113339 2003-04-10 17:35:44Z julian $
31 */
32
33/*
34 * Machine independent bits of mutex implementation.
35 */
36
37#include "opt_adaptive_mutexes.h"
38#include "opt_ddb.h"

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

67 */
68#define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED)
69
70#define mtx_owner(m) (mtx_unowned((m)) ? NULL \
71 : (struct thread *)((m)->mtx_lock & MTX_FLAGMASK))
72
73/* XXXKSE This test will change. */
74#define thread_running(td) \
31 */
32
33/*
34 * Machine independent bits of mutex implementation.
35 */
36
37#include "opt_adaptive_mutexes.h"
38#include "opt_ddb.h"

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

67 */
68#define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED)
69
70#define mtx_owner(m) (mtx_unowned((m)) ? NULL \
71 : (struct thread *)((m)->mtx_lock & MTX_FLAGMASK))
72
73/* XXXKSE This test will change. */
74#define thread_running(td) \
75 ((td)->td_kse != NULL && (td)->td_kse->ke_oncpu != NOCPU)
75 (td->td_state == TDS_RUNNING)
76 /* ((td)->td_oncpu != NOCPU) */
76
77/*
78 * Lock classes for sleep and spin mutexes.
79 */
80struct lock_class lock_class_mtx_sleep = {
81 "sleep mutex",
82 LC_SLEEPLOCK | LC_RECURSABLE
83};

--- 908 unchanged lines hidden ---
77
78/*
79 * Lock classes for sleep and spin mutexes.
80 */
81struct lock_class lock_class_mtx_sleep = {
82 "sleep mutex",
83 LC_SLEEPLOCK | LC_RECURSABLE
84};

--- 908 unchanged lines hidden ---