mutex.c revision dafcb997e390efa4423883dafd100c975c4095d6
/*
* Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: mutex.c,v 1.8 2004/03/05 05:11:16 marka Exp $ */
#include <config.h>
#include <stdio.h>
#include <time.h>
do { \
} \
} while (0)
do { \
} \
} while (0)
#define ISC_MUTEX_MAX_LOCKERS 32
typedef struct {
const char * file;
int line;
unsigned count;
struct timeval locked_total;
struct timeval wait_total;
struct isc_mutexstats {
const char * file; /* File mutex was created in. */
int line; /* Line mutex was created on. */
unsigned count;
struct timeval locked_total;
struct timeval wait_total;
};
int i;
return ISC_R_UNEXPECTED;
if (stats_init == ISC_FALSE) {
for (i = 0; i < TABLESIZE; i++) {
}
}
for (i = 0; i < TABLESIZE; i++) {
break;
}
}
for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) {
}
return ISC_R_SUCCESS;
}
struct timeval postlock_t;
int i;
for (i = 0; i < ISC_MUTEX_MAX_LOCKERS; i++) {
break;
break;
}
}
return (ISC_R_UNEXPECTED);
}
return ISC_R_SUCCESS;
}
}
}
void
int i, j;
for (i = 0; i < TABLESIZE; i++) {
continue;
);
for (j = 0; j < ISC_MUTEX_MAX_LOCKERS; j++) {
continue;
);
}
}
}
#endif /* ISC_MUTEX_PROFILE */
#if ISC_MUTEX_DEBUG && defined(PTHREAD_MUTEX_ERRORCHECK)
{
if (pthread_mutexattr_init(&attr) != 0)
return ISC_R_UNEXPECTED;
return ISC_R_UNEXPECTED;
return ISC_R_UNEXPECTED;
return ISC_R_SUCCESS;
}
#endif
PTHREAD_MUTEX_ERRORCHECK, /* m_type */
0 /* m_flags, which appears to be unused. */
};
#endif