mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1026580 - Remove an infinite loop possibility from AsyncTransactionTracker::WaitComplete() r=nical
This commit is contained in:
parent
e5f6b8cedc
commit
40addacbce
@ -33,16 +33,21 @@ AsyncTransactionTracker::WaitComplete()
|
||||
|
||||
MonitorAutoLock mon(mCompletedMonitor);
|
||||
int count = 0;
|
||||
while (!mCompleted) {
|
||||
const int maxCount = 5;
|
||||
while (!mCompleted && (count < maxCount)) {
|
||||
if (!NS_SUCCEEDED(mCompletedMonitor.Wait(PR_MillisecondsToInterval(10000)))) {
|
||||
NS_WARNING("Failed to wait Monitor");
|
||||
return;
|
||||
}
|
||||
if (count > 1) {
|
||||
NS_WARNING("Waiting async transaction complete.");
|
||||
printf_stderr("Waiting async transaction complete.\n");
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
||||
if (!mCompleted) {
|
||||
printf_stderr("Timeout of waiting transaction complete.");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user