From: Wouter Wijngaards Date: Tue, 14 Aug 2007 13:33:41 +0000 (+0000) Subject: enable for lock checks. X-Git-Tag: release-0.5~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d07e1b9c3a416e45f2bd11df971f9209eebf389;p=thirdparty%2Funbound.git enable for lock checks. git-svn-id: file:///svn/unbound/trunk@514 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/configure.ac b/configure.ac index 52fac5494..ee4143a5b 100644 --- a/configure.ac +++ b/configure.ac @@ -481,6 +481,14 @@ if test x_$enable_static_exe = x_yes; then staticexe="-static" fi +# set lock checking if requested +AC_ARG_ENABLE(lock_checks, AC_HELP_STRING([--enable-lock-checks], + [ enable to check lock and unlock calls, for debug purposes ]), + , ) +if test x_$enable_lock_checks = x_yes; then + AC_DEFINE(ENABLE_LOCK_CHECKS, 1, [Define if you want to use debug lock checking (slow).]) +fi + # check to see if libraries are needed for these functions. AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, inet_pton) diff --git a/doc/Changelog b/doc/Changelog index 7a48d1e0d..7a6e05e9f 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -5,6 +5,7 @@ - accounting of memory improved - outbound entries are allocated in the query region they are for. - extensive debugging for memory allocations. + - --enable-lock-checks can be used to enable lock checking. 13 August 2007: Wouter - fixup makefile, if lexer is missing give nice error and do not diff --git a/doc/README b/doc/README index 3e6a5077c..54a844e6c 100644 --- a/doc/README +++ b/doc/README @@ -28,6 +28,9 @@ This software is under BSD license, see LICENSE for details. * --enable-static-exe This enables a debug option to statically link, against ldns and libevent libraries. + * --enable-lock-checks + This enables a debug option to check lock and unlock calls. It needs + a recent pthreads library to work. Known issues ------------ diff --git a/util/locks.h b/util/locks.h index 706574ac2..32aafc723 100644 --- a/util/locks.h +++ b/util/locks.h @@ -70,7 +70,7 @@ } while(0) /** DEBUG: use thread debug whenever possible */ -#if defined(HAVE_PTHREAD) && defined(HAVE_PTHREAD_SPINLOCK_T) +#if defined(HAVE_PTHREAD) && defined(HAVE_PTHREAD_SPINLOCK_T) && defined(ENABLE_LOCK_CHECKS) # define USE_THREAD_DEBUG #endif