Deleted Added
full compact
kern_rwlock.c (154941) kern_rwlock.c (154973)
1/*-
2 * Copyright (c) 2006 John Baldwin <jhb@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * SUCH DAMAGE.
28 */
29
30/*
31 * Machine independent bits of reader/writer lock implementation.
32 */
33
34#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2006 John Baldwin <jhb@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

27 * SUCH DAMAGE.
28 */
29
30/*
31 * Machine independent bits of reader/writer lock implementation.
32 */
33
34#include <sys/cdefs.h>
35__FBSDID("$FreeBSD: head/sys/kern/kern_rwlock.c 154941 2006-01-27 23:13:26Z jhb $");
35__FBSDID("$FreeBSD: head/sys/kern/kern_rwlock.c 154973 2006-01-29 02:35:22Z mlaier $");
36
37#include "opt_ddb.h"
38
39#include <sys/param.h>
40#include <sys/ktr.h>
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/proc.h>

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

556 struct thread *td;
557
558 rw = (struct rwlock *)lock;
559
560 db_printf(" state: ");
561 if (rw->rw_lock == RW_UNLOCKED)
562 db_printf("UNLOCKED\n");
563 else if (rw->rw_lock & RW_LOCK_READ)
36
37#include "opt_ddb.h"
38
39#include <sys/param.h>
40#include <sys/ktr.h>
41#include <sys/lock.h>
42#include <sys/mutex.h>
43#include <sys/proc.h>

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

556 struct thread *td;
557
558 rw = (struct rwlock *)lock;
559
560 db_printf(" state: ");
561 if (rw->rw_lock == RW_UNLOCKED)
562 db_printf("UNLOCKED\n");
563 else if (rw->rw_lock & RW_LOCK_READ)
564 db_printf("RLOCK: %d locks\n", RW_READERS(rw->rw_lock));
564 db_printf("RLOCK: %jd locks\n",
565 (intmax_t)(RW_READERS(rw->rw_lock)));
565 else {
566 td = rw_owner(rw);
567 db_printf("WLOCK: %p (tid %d, pid %d, \"%s\")\n", td,
568 td->td_tid, td->td_proc->p_pid, td->td_proc->p_comm);
569 }
570 db_printf(" waiters: ");
571 switch (rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS)) {
572 case RW_LOCK_READ_WAITERS:

--- 15 unchanged lines hidden ---
566 else {
567 td = rw_owner(rw);
568 db_printf("WLOCK: %p (tid %d, pid %d, \"%s\")\n", td,
569 td->td_tid, td->td_proc->p_pid, td->td_proc->p_comm);
570 }
571 db_printf(" waiters: ");
572 switch (rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS)) {
573 case RW_LOCK_READ_WAITERS:

--- 15 unchanged lines hidden ---