mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-02-03 20:29:28 -05:00
don't forget to lock it.
git-svn-id: file:///svn/unbound/trunk@793 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
83f8775d5a
commit
1152a4c5e8
1 changed files with 7 additions and 1 deletions
|
|
@ -203,8 +203,12 @@ int
|
|||
ub_val_ctx_poll(struct ub_val_ctx* ctx)
|
||||
{
|
||||
struct timeval t;
|
||||
int r;
|
||||
memset(&t, 0, sizeof(t));
|
||||
return pollit(ctx, &t);
|
||||
lock_basic_lock(&ctx->rrpipe_lock);
|
||||
r = pollit(ctx, &t);
|
||||
lock_basic_unlock(&ctx->rrpipe_lock);
|
||||
return r;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -212,7 +216,9 @@ ub_val_ctx_wait(struct ub_val_ctx* ctx)
|
|||
{
|
||||
/* TODO until no more queries outstanding */
|
||||
while(1) {
|
||||
lock_basic_lock(&ctx->rrpipe_lock);
|
||||
(void)pollit(ctx, NULL);
|
||||
lock_basic_unlock(&ctx->rrpipe_lock);
|
||||
ub_val_ctx_process(ctx);
|
||||
}
|
||||
return UB_NOERROR;
|
||||
|
|
|
|||
Loading…
Reference in a new issue