]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
fixup locking in test code.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 21 Sep 2007 13:55:07 +0000 (13:55 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 21 Sep 2007 13:55:07 +0000 (13:55 +0000)
git-svn-id: file:///svn/unbound/trunk@629 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
testcode/unitverify.c

index c2f62cfb1b961732690e79d55a460e89f3ce5dee..b9463c1f75eda91bc53bc177246198dd09e6ac7d 100644 (file)
@@ -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. 
index f6359bd738dc6a76b8a1d088e82bb13280bd913f..2936309fe4eca1a703ccb8498d41cef48f1ee82e 100644 (file)
@@ -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);