From: Wouter Wijngaards Date: Wed, 28 Oct 2015 10:28:26 +0000 (+0000) Subject: - Fix checklock testcode for linux threads on exit. X-Git-Tag: release-1.5.7rc1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c585cbc2d9a2b0bbe259834b23489eefb50eb5a0;p=thirdparty%2Funbound.git - Fix checklock testcode for linux threads on exit. git-svn-id: file:///svn/unbound/trunk@3522 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 2b0b5a66f..3e92b4dcd 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/testcode/checklocks.c b/testcode/checklocks.c index 5815e4fd0..9f5953ea1 100644 --- a/testcode/checklocks.c +++ b/testcode/checklocks.c @@ -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");