kern_rwlock.c (167492) | kern_rwlock.c (167504) |
---|---|
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 167492 2007-03-12 20:10:29Z jhb $"); | 35__FBSDID("$FreeBSD: head/sys/kern/kern_rwlock.c 167504 2007-03-13 16:51:27Z jhb $"); |
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> --- 797 unchanged lines hidden (view full) --- 841 struct thread *td; 842 843 rw = (struct rwlock *)lock; 844 845 db_printf(" state: "); 846 if (rw->rw_lock == RW_UNLOCKED) 847 db_printf("UNLOCKED\n"); 848 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> --- 797 unchanged lines hidden (view full) --- 841 struct thread *td; 842 843 rw = (struct rwlock *)lock; 844 845 db_printf(" state: "); 846 if (rw->rw_lock == RW_UNLOCKED) 847 db_printf("UNLOCKED\n"); 848 else if (rw->rw_lock & RW_LOCK_READ) |
849 db_printf("RLOCK: %jd locks\n", 850 (intmax_t)(RW_READERS(rw->rw_lock))); | 849 db_printf("RLOCK: %ju locks\n", 850 (uintmax_t)(RW_READERS(rw->rw_lock))); |
851 else { 852 td = rw_wowner(rw); 853 db_printf("WLOCK: %p (tid %d, pid %d, \"%s\")\n", td, 854 td->td_tid, td->td_proc->p_pid, td->td_proc->p_comm); 855 } 856 db_printf(" waiters: "); 857 switch (rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS)) { 858 case RW_LOCK_READ_WAITERS: --- 15 unchanged lines hidden --- | 851 else { 852 td = rw_wowner(rw); 853 db_printf("WLOCK: %p (tid %d, pid %d, \"%s\")\n", td, 854 td->td_tid, td->td_proc->p_pid, td->td_proc->p_comm); 855 } 856 db_printf(" waiters: "); 857 switch (rw->rw_lock & (RW_LOCK_READ_WAITERS | RW_LOCK_WRITE_WAITERS)) { 858 case RW_LOCK_READ_WAITERS: --- 15 unchanged lines hidden --- |