With Socket:Dispose from using Thread.Abort to less agressive alternative.
commite4afc97bdd37e60f86b757710da630b634a02019
authorRodrigo Kumpera <kumpera@gmail.com>
Wed, 27 Jun 2012 20:36:54 +0000 (27 17:36 -0300)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 29 Jun 2012 18:32:24 +0000 (29 15:32 -0300)
tree5e5412770b132362d218da745e84d34f234e43c4
parent33bec03932cae85fafe9961c80c34c9df820519e
With Socket:Dispose from using Thread.Abort to less agressive alternative.

* Socket_2_1.cs: When closing a socket we need to abort any
pending syscalls to that socket. For most syscalls the kernel
does it for us. But accept/connect on linux requires extra
love.

We previously used Thread.Abort to implement that, but this
is a pretty radical solution with very complicated ramifications.
So instead now we use a new icall cancel_blocking_socket_operation
that makes sure we only abort the syscall and do nothing else.

This reduces the trouble surface a lot given how tricky
Thread.Abort is.
mcs/class/System/System.Net.Sockets/Socket.cs
mcs/class/System/System.Net.Sockets/Socket_2_1.cs