[Mono-dev] [PATCH] Interrupting socket calls on Windows during shutdown.

Zoltan Varga vargaz at gmail.com
Mon Jun 22 11:47:53 EDT 2009


Hi, looks mostly ok, just:
- there is no need for locking the thread in socket-io.c, interrupt_on_stop
is only set for the current thread.

                        Zoltan

On Mon, Jun 22, 2009 at 4:49 PM, Bill Holmes <billholmes54 at gmail.com> wrote:

> Hi,
>
> We have run into another problem on Windows with socket calls on
> background threads not stopping during shutdown.  The attached patch
> sets a flag on the thread struct around the socket calls.  If this
> flag is set when thread manage is called that thread will be killed
> during the APC call.
>
> http://msdn.microsoft.com/en-us/library/ms684954(VS.85).aspx<http://msdn.microsoft.com/en-us/library/ms684954%28VS.85%29.aspx>
>
> This only applies to threads that are stopping (process shutdown) and
> are background threads.
>
> -bill
>
> 2009-06-22  Bill Holmes  <billholmes54 at gmail.com>
>
>        * object-internals.h : Adding interrupt_on_stop field.
>
>        * threads.c (mono_thread_request_interruption) : On Windows exit the
> thread if interrupt_on_stop is set.
>
>        * socket-io.c (ves_icall_System_Net_Sockets_Socket_Accept_internal)
> :
>          Removing old interrupt logic and setting the interrupt_on_stop for
> the
>          thread when calling accept.
>
>        * socket-io.c (ves_icall_System_Net_Sockets_Socket_Receive_internal)
> :
>          setting the interrupt_on_stop for the thread when calling accept.
>
>        * Thread.cs : Adding interrupt_on_stop field.
>
>        Contributed under MIT/X11 license.
>
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090622/3d497804/attachment.html 


More information about the Mono-devel-list mailing list