Skip to content
Commit a4871052 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

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
parent 24498bb7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment