]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
enable for lock checks.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Aug 2007 13:33:41 +0000 (13:33 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 14 Aug 2007 13:33:41 +0000 (13:33 +0000)
git-svn-id: file:///svn/unbound/trunk@514 be551aaa-1e26-0410-a405-d3ace91eadb9

configure.ac
doc/Changelog
doc/README
util/locks.h

index 52fac5494ac3044f42f604ca5704edf359365794..ee4143a5bcf3fd28daa6ec0411ea239e209d2d38 100644 (file)
@@ -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)
index 7a48d1e0d14d75032cb6dd206aef6bc01d6c2b5e..7a6e05e9ff30aac9d66f8d3acdd762215c13bfb8 100644 (file)
@@ -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
index 3e6a5077c918d3e5471cff9f703fcd50d65a8b6f..54a844e6c26598b481602e68f7f84c6b3a9f82d5 100644 (file)
@@ -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
 ------------
index 706574ac2b8a56151dd51918f5c0dc04939aef2d..32aafc723f2d39b6c06c354fc1ffe3a97881c2ff 100644 (file)
@@ -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