Commit 5e5b467e authored by Mark Andrews's avatar Mark Andrews
Browse files

1833. [bug] Race condition in isc_mutex_lock_profile(). [RT #13660]

parent 713ad87a
1833. [bug] Race condition in isc_mutex_lock_profile(). [RT #13660]
1832. [bug] named fails to return BADKEY on unknown TSIG algorithm.
[RT #13620]
......
......@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mutex.c,v 1.8 2004/03/05 05:11:16 marka Exp $ */
/* $Id: mutex.c,v 1.9 2005/03/16 01:56:17 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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment