From 3730c55a87e51ff0f021a49ebdaf4630b3ae8a37 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 12 Dec 2022 17:29:15 +0100 Subject: QWaitCondition: remove a misleading comment The comment seems to imply that POSIX "does not allow for spurious wakeups" on a pthread_cond_t, or that it doesn't allow for them to happen on certain conditions. That's a misleading generalization. POSIX allows for spurious wakeups [1], so we must handle them, end of story. [1] https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_cond_timedwait.html Task-number: QTBUG-109364 Change-Id: Iffcfbd85ec84c4e94a051f235fd3b3557a3aea9c Reviewed-by: Thiago Macieira --- src/corelib/thread/qwaitcondition_unix.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index 09dc0f0685..4d27e47c3e 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp +++ b/src/corelib/thread/qwaitcondition_unix.cpp @@ -111,9 +111,7 @@ public: code = pthread_cond_wait(&cond, &mutex); } if (code == 0 && wakeups == 0) { - // many vendors warn of spurious wakeups from - // pthread_cond_wait(), especially after signal delivery, - // even though POSIX doesn't allow for it... sigh + // spurious wakeup continue; } break; -- cgit v1.2.3