diff options
author | dougb <dougb@FreeBSD.org> | 2005-12-29 04:22:58 +0000 |
---|---|---|
committer | dougb <dougb@FreeBSD.org> | 2005-12-29 04:22:58 +0000 |
commit | 13e6e55147add29e8d7701891f70aefeb3d74645 (patch) | |
tree | 570b6e4f35462e81147786cc2f272d28fac7f470 /contrib/bind9/lib/isc/pthreads/mutex.c | |
parent | 9123af99f7956e2383e5b9c4d39e84bea89915fe (diff) | |
download | FreeBSD-src-13e6e55147add29e8d7701891f70aefeb3d74645.zip FreeBSD-src-13e6e55147add29e8d7701891f70aefeb3d74645.tar.gz |
Vendor import of BIND 9.3.2
Diffstat (limited to 'contrib/bind9/lib/isc/pthreads/mutex.c')
-rw-r--r-- | contrib/bind9/lib/isc/pthreads/mutex.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/contrib/bind9/lib/isc/pthreads/mutex.c b/contrib/bind9/lib/isc/pthreads/mutex.c index e29e92b..71db669 100644 --- a/contrib/bind9/lib/isc/pthreads/mutex.c +++ b/contrib/bind9/lib/isc/pthreads/mutex.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000-2002 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: mutex.c,v 1.6.26.3 2004/03/08 09:04:55 marka Exp $ */ +/* $Id: mutex.c,v 1.6.26.5 2005/03/17 03:58:32 marka Exp $ */ #include <config.h> @@ -126,19 +126,6 @@ isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) { isc_mutexlocker_t *locker = NULL; int i; - for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) { - if (mp->stats->lockers[i].file == NULL) { - locker = &mp->stats->lockers[i]; - locker->file = file; - locker->line = line; - break; - } else if (mp->stats->lockers[i].file == file && - mp->stats->lockers[i].line == line) { - locker = &mp->stats->lockers[i]; - break; - } - } - gettimeofday(&prelock_t, NULL); if (pthread_mutex_lock(&mp->mutex) != 0) @@ -152,6 +139,19 @@ isc_mutex_lock_profile(isc_mutex_t *mp, const char *file, int line) { mp->stats->count++; timevaladd(&mp->stats->wait_total, &postlock_t); + for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) { + if (mp->stats->lockers[i].file == NULL) { + locker = &mp->stats->lockers[i]; + locker->file = file; + locker->line = line; + break; + } else if (mp->stats->lockers[i].file == file && + mp->stats->lockers[i].line == line) { + locker = &mp->stats->lockers[i]; + break; + } + } + if (locker != NULL) { locker->count++; timevaladd(&locker->wait_total, &postlock_t); |