From 463bd32b26934c628e4b409d72512a81acf509b0 Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 21 Sep 2007 13:55:07 +0000 Subject: [PATCH] fixup locking in test code. git-svn-id: file:///svn/unbound/trunk@629 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 1 + testcode/unitverify.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/doc/Changelog b/doc/Changelog index c2f62cfb1..b9463c1f7 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 21 September 2007: Wouter - fixup empty_DS_name allocated in wrong region. + - fixup testcode lock safety. 20 September 2007: Wouter - fixup and test for NSEC wildcard with empty nonterminals. diff --git a/testcode/unitverify.c b/testcode/unitverify.c index f6359bd73..2936309fe 100644 --- a/testcode/unitverify.c +++ b/testcode/unitverify.c @@ -93,7 +93,13 @@ entry_to_repinfo(struct entry* e, struct alloc_cache* alloc, struct region* int ret; struct edns_data edns; entry_to_buf(e, pkt); + /* lock alloc lock to please lock checking software. + * alloc_special_obtain assumes it is talking to a ub-alloc, + * and does not need to perform locking. Here the alloc is + * the only one, so we lock it here */ + lock_quick_lock(&alloc->lock); ret = reply_info_parse(pkt, alloc, qi, rep, region, &edns); + lock_quick_unlock(&alloc->lock); if(ret != 0) { printf("parse code %d: %s\n", ret, ldns_lookup_by_id(ldns_rcodes, ret)->name); -- 2.47.2