зеркало из https://github.com/mozilla/gecko-dev.git
Back out caa97320d506 (bug 658580) temporarily to get m-i in a known good state. a=backout
This commit is contained in:
Родитель
7c14d57369
Коммит
3a92543b49
|
@ -593,6 +593,19 @@ NS_IMETHODIMP
|
||||||
nsSocketTransportService::OnProcessNextEvent(nsIThreadInternal *thread,
|
nsSocketTransportService::OnProcessNextEvent(nsIThreadInternal *thread,
|
||||||
PRBool mayWait, PRUint32 depth)
|
PRBool mayWait, PRUint32 depth)
|
||||||
{
|
{
|
||||||
|
// DoPollIteration doesn't support being called recursively. This case
|
||||||
|
// should only happen when someone (e.g., PSM) is issuing a synchronous
|
||||||
|
// proxy call from this thread to the main thread.
|
||||||
|
if (depth > 1)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
|
// Favor processing existing sockets before other events.
|
||||||
|
DoPollIteration(PR_FALSE);
|
||||||
|
|
||||||
|
PRBool val;
|
||||||
|
while (mayWait && NS_SUCCEEDED(thread->HasPendingEvents(&val)) && !val)
|
||||||
|
DoPollIteration(PR_TRUE);
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -622,24 +635,8 @@ nsSocketTransportService::Run()
|
||||||
threadInt->SetObserver(this);
|
threadInt->SetObserver(this);
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
PRBool pendingEvents = PR_FALSE;
|
// process all pending events
|
||||||
thread->HasPendingEvents(&pendingEvents);
|
NS_ProcessPendingEvents(thread);
|
||||||
|
|
||||||
do {
|
|
||||||
// If there are pending events for this thread then
|
|
||||||
// DoPollIteration() should service the network without blocking.
|
|
||||||
DoPollIteration(!pendingEvents);
|
|
||||||
|
|
||||||
// If nothing was pending before the poll, it might be now
|
|
||||||
if (!pendingEvents)
|
|
||||||
thread->HasPendingEvents(&pendingEvents);
|
|
||||||
|
|
||||||
if (pendingEvents) {
|
|
||||||
NS_ProcessNextEvent(thread);
|
|
||||||
pendingEvents = PR_FALSE;
|
|
||||||
thread->HasPendingEvents(&pendingEvents);
|
|
||||||
}
|
|
||||||
} while (pendingEvents);
|
|
||||||
|
|
||||||
// now that our event queue is empty, check to see if we should exit
|
// now that our event queue is empty, check to see if we should exit
|
||||||
{
|
{
|
||||||
|
@ -647,6 +644,9 @@ nsSocketTransportService::Run()
|
||||||
if (mShuttingDown)
|
if (mShuttingDown)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wait for and process the next pending event
|
||||||
|
NS_ProcessNextEvent(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
SOCKET_LOG(("STS shutting down thread\n"));
|
SOCKET_LOG(("STS shutting down thread\n"));
|
||||||
|
|
Загрузка…
Ссылка в новой задаче