Fix host lookups hanging with concurrency

This commit is contained in:
Márcio Martins 2020-08-04 19:27:08 +01:00 committed by Mathias LANG
parent 862b5d470c
commit deaebb18d8

View file

@ -150,7 +150,10 @@ final class EventDriverDNS_GAI(Events : EventDriverEvents, Signals : EventDriver
size_t lastmax; size_t lastmax;
foreach (i, ref l; m_lookups) { foreach (i, ref l; m_lookups) {
if (i > m_maxHandle) break; 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 // synchronize the other fields in m_lookup with the lookup thread
atomicFence(); atomicFence();