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 <thiago.macieira@intel.com>
This commit is contained in:
parent
05e72d53a6
commit
3730c55a87
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user