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:
parent
3f38ba3896
commit
a8725729bf
10
src/ipc.cpp
10
src/ipc.cpp
|
@ -186,11 +186,13 @@ bool IPC::waitUntilAccepted(time_t postTime, int32_t timeout/*=-1*/)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
time_t start = time(0);
|
time_t start = time(0);
|
||||||
while (!(result = isEventAccepted(postTime)))
|
forever {
|
||||||
{
|
result = isEventAccepted(postTime);
|
||||||
qApp->processEvents();
|
if (result || (timeout > 0 && difftime(time(0), start) >= timeout))
|
||||||
if (timeout > 0 && difftime(time(0), start) >= timeout)
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
qApp->processEvents();
|
||||||
|
QThread::msleep(0);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user