1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

readd msleep with lowest possible sleep time

This commit is contained in:
Nils Fenner 2015-10-12 20:28:03 +02:00
parent 3f38ba3896
commit a8725729bf
No known key found for this signature in database
GPG Key ID: 9591A163FF9BE04C

View File

@ -186,11 +186,13 @@ bool IPC::waitUntilAccepted(time_t postTime, int32_t timeout/*=-1*/)
{
bool result = false;
time_t start = time(0);
while (!(result = isEventAccepted(postTime)))
{
qApp->processEvents();
if (timeout > 0 && difftime(time(0), start) >= timeout)
forever {
result = isEventAccepted(postTime);
if (result || (timeout > 0 && difftime(time(0), start) >= timeout))
break;
qApp->processEvents();
QThread::msleep(0);
}
return result;
}