diff options
Diffstat (limited to 'libntp/ntp_worker.c')
-rw-r--r-- | libntp/ntp_worker.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libntp/ntp_worker.c b/libntp/ntp_worker.c index f5642e10dc1e..087f06c95308 100644 --- a/libntp/ntp_worker.c +++ b/libntp/ntp_worker.c @@ -27,6 +27,8 @@ blocking_child ** blocking_children; size_t blocking_children_alloc; int worker_per_query; /* boolean */ int intres_req_pending; +volatile u_int blocking_child_ready_seen; +volatile u_int blocking_child_ready_done; #ifndef HAVE_IO_COMPLETION_PORT @@ -262,6 +264,31 @@ process_blocking_resp( req_child_exit(c); } +void +harvest_blocking_responses(void) +{ + int idx; + blocking_child* cp; + u_int scseen, scdone; + + scseen = blocking_child_ready_seen; + scdone = blocking_child_ready_done; + if (scdone != scseen) { + blocking_child_ready_done = scseen; + for (idx = 0; idx < blocking_children_alloc; idx++) { + cp = blocking_children[idx]; + if (NULL == cp) + continue; + scseen = cp->resp_ready_seen; + scdone = cp->resp_ready_done; + if (scdone != scseen) { + cp->resp_ready_done = scseen; + process_blocking_resp(cp); + } + } + } +} + /* * blocking_child_common runs as a forked child or a thread |