Deleted Added
sdiff udiff text old ( 176076 ) new ( 177843 )
full compact
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 176076 2008-02-07 06:16:54Z jeff $");
36
37#include "opt_ddb.h"
38#include "opt_no_adaptive_rwlocks.h"
39
40#include <sys/param.h>
41#include <sys/ktr.h>
42#include <sys/lock.h>
43#include <sys/mutex.h>

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

198 WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER | LOP_EXCLUSIVE, file,
199 line);
200 __rw_wlock(rw, curthread, file, line);
201 LOCK_LOG_LOCK("WLOCK", &rw->lock_object, 0, rw->rw_recurse, file, line);
202 WITNESS_LOCK(&rw->lock_object, LOP_EXCLUSIVE, file, line);
203 curthread->td_locks++;
204}
205
206void
207_rw_wunlock(struct rwlock *rw, const char *file, int line)
208{
209
210 MPASS(curthread != NULL);
211 KASSERT(rw->rw_lock != RW_DESTROYED,
212 ("rw_wunlock() of destroyed rwlock @ %s:%d", file, line));
213 _rw_assert(rw, RA_WLOCKED, file, line);

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

381 lock_profile_obtain_lock_success( &rw->lock_object, contested,
382 waittime, file, line);
383 LOCK_LOG_LOCK("RLOCK", &rw->lock_object, 0, 0, file, line);
384 WITNESS_LOCK(&rw->lock_object, 0, file, line);
385 curthread->td_locks++;
386 curthread->td_rw_rlocks++;
387}
388
389void
390_rw_runlock(struct rwlock *rw, const char *file, int line)
391{
392 struct turnstile *ts;
393 uintptr_t x, v, queue;
394
395 KASSERT(rw->rw_lock != RW_DESTROYED,
396 ("rw_runlock() of destroyed rwlock @ %s:%d", file, line));

--- 560 unchanged lines hidden ---