mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-09-13 13:27:43 +02:00
fptrwlist and remove oldhack with islocked param.
git-svn-id: file:///svn/unbound/trunk@805 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
@@ -543,12 +543,9 @@ msgreply_sizefunc(void* k, void* d)
|
||||
}
|
||||
|
||||
void
|
||||
query_entry_delete(void *k, void* ATTR_UNUSED(arg), int is_locked)
|
||||
query_entry_delete(void *k, void* ATTR_UNUSED(arg))
|
||||
{
|
||||
struct msgreply_entry* q = (struct msgreply_entry*)k;
|
||||
if(is_locked) {
|
||||
lock_rw_unlock(&q->entry.lock);
|
||||
}
|
||||
lock_rw_destroy(&q->entry.lock);
|
||||
query_info_clear(&q->key);
|
||||
free(q);
|
||||
|
||||
@@ -268,7 +268,7 @@ void query_info_clear(struct query_info* m);
|
||||
size_t msgreply_sizefunc(void* k, void* d);
|
||||
|
||||
/** delete msgreply_entry key structure */
|
||||
void query_entry_delete(void *q, void* arg, int is_locked);
|
||||
void query_entry_delete(void *q, void* arg);
|
||||
|
||||
/** delete reply_info data structure */
|
||||
void reply_info_delete(void* d, void* arg);
|
||||
|
||||
@@ -121,14 +121,11 @@ ub_rrset_compare(void* k1, void* k2)
|
||||
}
|
||||
|
||||
void
|
||||
ub_rrset_key_delete(void* key, void* userdata, int is_locked)
|
||||
ub_rrset_key_delete(void* key, void* userdata)
|
||||
{
|
||||
struct ub_packed_rrset_key* k = (struct ub_packed_rrset_key*)key;
|
||||
struct alloc_cache* a = (struct alloc_cache*)userdata;
|
||||
k->id = 0;
|
||||
if(is_locked) {
|
||||
lock_rw_unlock(&k->entry.lock);
|
||||
}
|
||||
free(k->rk.dname);
|
||||
k->rk.dname = NULL;
|
||||
alloc_special_release(a, k);
|
||||
|
||||
@@ -300,13 +300,12 @@ int rrsetdata_equal(struct packed_rrset_data* d1, struct packed_rrset_data* d2);
|
||||
|
||||
/**
|
||||
* Old key to be deleted. RRset keys are recycled via alloc.
|
||||
* The id is set to 0. So that other threads, after acquiring a lock always
|
||||
* get the correct value, in this case the 0 deleted-special value.
|
||||
* @param key: struct ub_packed_rrset_key*.
|
||||
* @param userdata: alloc structure to use for recycling.
|
||||
* @param is_locked: if the key is locked, the id is set to 0 while it is
|
||||
* still locked. So that other threads, after acquiring a lock always
|
||||
* get the correct value, in this case the 0 deleted-special value.
|
||||
*/
|
||||
void ub_rrset_key_delete(void* key, void* userdata, int is_locked);
|
||||
void ub_rrset_key_delete(void* key, void* userdata);
|
||||
|
||||
/**
|
||||
* Old data to be deleted.
|
||||
|
||||
Reference in New Issue
Block a user