From deaebb18d814fbebacfd5aca82201df9df3995d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Martins?= Date: Tue, 4 Aug 2020 19:27:08 +0100 Subject: [PATCH] Fix host lookups hanging with concurrency --- source/eventcore/drivers/posix/dns.d | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/eventcore/drivers/posix/dns.d b/source/eventcore/drivers/posix/dns.d index 6875a0a..dee73b4 100644 --- a/source/eventcore/drivers/posix/dns.d +++ b/source/eventcore/drivers/posix/dns.d @@ -150,7 +150,10 @@ final class EventDriverDNS_GAI(Events : EventDriverEvents, Signals : EventDriver size_t lastmax; foreach (i, ref l; m_lookups) { if (i > m_maxHandle) break; - if (!atomicLoad(l.done)) continue; + if (!atomicLoad(l.done)) { + lastmax = i; + continue; + } // synchronize the other fields in m_lookup with the lookup thread atomicFence();