]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix checklock testcode for linux threads on exit.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 28 Oct 2015 10:28:26 +0000 (10:28 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 28 Oct 2015 10:28:26 +0000 (10:28 +0000)
git-svn-id: file:///svn/unbound/trunk@3522 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
testcode/checklocks.c

index 2b0b5a66f7304b045b5be528adb2db22bfbc6a5a..3e92b4dcd6fb15eb4135e42825055353dece25ea 100644 (file)
@@ -1,3 +1,6 @@
+28 October 2015: Wouter
+       - Fix checklock testcode for linux threads on exit.
+
 27 October 2015: Wouter
        - isblank() compat implementation.
        - detect libexpat without xml_StopParser function.
index 5815e4fd08878d1a3efc97a56b0fa6326ec3ad6f..9f5953ea19f68135bf7f1bafbbe3a31f032b77c0 100644 (file)
@@ -502,6 +502,8 @@ void
 checklock_rdlock(enum check_lock_type type, struct checked_lock* lock,
         const char* func, const char* file, int line)
 {
+       if(key_deleted)
+               return;
 
        log_assert(type == check_lock_rwlock);
        checklock_lockit(type, lock, func, file, line,
@@ -520,6 +522,8 @@ void
 checklock_wrlock(enum check_lock_type type, struct checked_lock* lock,
         const char* func, const char* file, int line)
 {
+       if(key_deleted)
+               return;
        log_assert(type == check_lock_rwlock);
        checklock_lockit(type, lock, func, file, line,
                try_wr, timed_wr, &lock->u.rwlock, 0, 1);
@@ -555,6 +559,8 @@ void
 checklock_lock(enum check_lock_type type, struct checked_lock* lock,
         const char* func, const char* file, int line)
 {
+       if(key_deleted)
+               return;
        log_assert(type != check_lock_rwlock);
        switch(type) {
                case check_lock_mutex:
@@ -577,8 +583,10 @@ void
 checklock_unlock(enum check_lock_type type, struct checked_lock* lock,
         const char* func, const char* file, int line)
 {
-       struct thr_check *thr = (struct thr_check*)pthread_getspecific(
-               thr_debug_key);
+       struct thr_check *thr;
+       if(key_deleted)
+               return;
+       thr = (struct thr_check*)pthread_getspecific(thr_debug_key);
        checktype(type, lock, func, file, line);
        if(!thr) lock_error(lock, func, file, line, "no thread info");