From c6027a56e5c0f47d2486f9c963e940e3959ce825 Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Sun, 22 Nov 1998 09:31:10 +0000 Subject: [PATCH] Force the URL exit routine to be called via a PLEvent. This insures that the LIBNET() lock is not being held during the call... git-svn-id: svn://10.0.0.236/trunk@15130 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/network/module/nsNetThread.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/mozilla/network/module/nsNetThread.cpp b/mozilla/network/module/nsNetThread.cpp index 5e46664c6d1..0c184601e73 100644 --- a/mozilla/network/module/nsNetThread.cpp +++ b/mozilla/network/module/nsNetThread.cpp @@ -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(); } } \ No newline at end of file