aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/testcode/asynclook.c
diff options
context:
space:
mode:
Diffstat (limited to 'external/unbound/testcode/asynclook.c')
-rw-r--r--external/unbound/testcode/asynclook.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/external/unbound/testcode/asynclook.c b/external/unbound/testcode/asynclook.c
index 534489735..a2bdb6213 100644
--- a/external/unbound/testcode/asynclook.c
+++ b/external/unbound/testcode/asynclook.c
@@ -64,7 +64,7 @@ struct track_id {
/** true if cancelled */
int cancel;
/** a lock on this structure for thread safety */
- lock_basic_t lock;
+ lock_basic_type lock;
};
/**
@@ -164,7 +164,7 @@ struct ext_thr_info {
/** thread num for debug */
int thread_num;
/** thread id */
- ub_thread_t tid;
+ ub_thread_type tid;
/** context */
struct ub_ctx* ctx;
/** size of array to query */
@@ -335,12 +335,17 @@ ext_thread(void* arg)
r = ub_wait(inf->ctx);
checkerr("ub_ctx_wait", r);
}
+ /* if these locks are destroyed, or if the async_ids is freed, then
+ a use-after-free happens in another thread.
+ The allocation is only part of this test, though. */
+ /*
if(async_ids) {
for(i=0; i<inf->numq; i++) {
lock_basic_destroy(&async_ids[i].lock);
}
}
free(async_ids);
+ */
return NULL;
}
@@ -465,7 +470,7 @@ int main(int argc, char** argv)
return 1;
}
- /* perform asyncronous calls */
+ /* perform asynchronous calls */
num_wait = argc;
for(i=0; i<argc; i++) {
lookups[i].name = argv[i];