зеркало из https://github.com/mozilla/gecko-dev.git
fixes bug 273578 "XMLHttpRequest with async = false takes 100% CPU until request finished" r=jst sr=bz
This commit is contained in:
Родитель
36671db790
Коммит
fb27621347
|
@ -1611,6 +1611,10 @@ nsXMLHttpRequest::Send(nsIVariant *aBody)
|
||||||
if (!(mState & XML_HTTP_REQUEST_ASYNC)) {
|
if (!(mState & XML_HTTP_REQUEST_ASYNC)) {
|
||||||
while (mState & XML_HTTP_REQUEST_SYNCLOOPING) {
|
while (mState & XML_HTTP_REQUEST_SYNCLOOPING) {
|
||||||
modalEventQueue->ProcessPendingEvents();
|
modalEventQueue->ProcessPendingEvents();
|
||||||
|
|
||||||
|
// Be sure not to busy wait! (see bug 273578)
|
||||||
|
if (mState & XML_HTTP_REQUEST_SYNCLOOPING)
|
||||||
|
PR_Sleep(PR_MillisecondsToInterval(10));
|
||||||
}
|
}
|
||||||
|
|
||||||
mEventQService->PopThreadEventQueue(modalEventQueue);
|
mEventQService->PopThreadEventQueue(modalEventQueue);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче