зеркало из https://github.com/mozilla/pjs.git
Force the URL exit routine to be called via a PLEvent. This insures that the LIBNET() lock is not being held during the call...
This commit is contained in:
Родитель
4af009fea5
Коммит
b6b353628c
|
@ -857,16 +857,19 @@ net_CallExitRoutineProxy(Net_GetUrlExitFunc* exit_routine,
|
|||
FO_Present_Types format_out,
|
||||
MWContext* window_id)
|
||||
{
|
||||
CallExitRoutineProxyEvent* ev;
|
||||
|
||||
if (PR_GetCurrentThread() == gNetlibThread) {
|
||||
CallExitRoutineProxyEvent* ev;
|
||||
|
||||
ev = new CallExitRoutineProxyEvent(exit_routine, URL_s, status,
|
||||
format_out, window_id);
|
||||
if (nsnull != ev) {
|
||||
ev->Fire();
|
||||
}
|
||||
} else {
|
||||
net_CallExitRoutine(exit_routine, URL_s, status, format_out, window_id);
|
||||
/*
|
||||
* Always use a PLEvent to call the exit_routine(...). This is necessary
|
||||
* because when a connection is interrupted, the exit_routine(...) is called
|
||||
* inside of the LIBNET_LOCK().
|
||||
*
|
||||
* By always using an event, we are sure that the exit_routine(...) is not
|
||||
* called while the thread is holding the LIBNET_LOCK().
|
||||
*/
|
||||
ev = new CallExitRoutineProxyEvent(exit_routine, URL_s, status,
|
||||
format_out, window_id);
|
||||
if (nsnull != ev) {
|
||||
ev->Fire();
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче