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:
rpotts%netscape.com 1998-11-22 09:31:10 +00:00
Родитель 4af009fea5
Коммит b6b353628c
1 изменённых файлов: 13 добавлений и 10 удалений

Просмотреть файл

@ -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();
}
}