Do not terminate threads when doing dns lookups with timeout
author Albert Astals Cid
()
committer Albert Astals Cid
()
commit a4871052d09eecd928666d482427abebb5f39c56
tree 7a1ed9ddaab0dd6a8d969fd8fffda9ee424b83dc
parent 24498bb761630e24e39df1ea5c614136eff7310c
Do not terminate threads when doing dns lookups with timeout

patch based on dfaure and thiago's suggestions:

Thiago and I came up with a design like this:
* a single thread that makes async lookups. It's never blocked, it can always
almost immediately read new requests from a queue and start them.
* each request is encapsulated in a class that has the QString
but also a QSemaphore.
* the main thread can block using a timeout (QSemaphore::tryAcquire(timeout))
* the request class is stored using a shared pointer, so that it's only
deleted when neither the main thread nor the worker thread need it anymore
[otherwise the deletion is a problem, in the timeout case vs the normal case]

REVIEW: 102179
kio/kio/hostinfo.cpp