Threaded DNS: Handle spurious wakeups

As DarthGandalf noticed, POSIX allows spurious wakeups from pthread_cond_wait.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter
2012-02-19 12:13:25 +01:00
parent 8863d853c9
commit 252e6d7151
2 changed files with 20 additions and 5 deletions
+5
View File
@@ -149,6 +149,11 @@ private:
static void* TDNSThread(void* argument);
static void DoDNS(TDNSArg *arg);
/** Must be called with threadStatus->mutex held.
* @returns false when the calling DNS thread should exit.
*/
static bool ThreadNeeded(struct TDNSStatus* status);
TDNSStatus m_threadStatus;
#endif
protected: