diff options
author | Dick Porter <dick@acm.org> | 2002-08-20 17:48:15 +0400 |
---|---|---|
committer | Dick Porter <dick@acm.org> | 2002-08-20 17:48:15 +0400 |
commit | fa33bf99de0d1e520783e113eb425f8534469f5d (patch) | |
tree | 36e9fd9999b41ca77e09d89ee1ce7786a9afbbf3 /mcs/class/System/System.Net.Sockets | |
parent | d945b27f76e3c419cf9f751f85ea655fb3d6901d (diff) |
2002-08-20 Dick Porter <dick@ximian.com>
* Socket.cs: Fix deadlock when the AsyncResult callback calls
End*(). Set the async request's worker property so it can return
results. These two fixes combined fix bug 28092.
svn path=/trunk/mcs/; revision=6808
Diffstat (limited to 'mcs/class/System/System.Net.Sockets')
-rw-r--r-- | mcs/class/System/System.Net.Sockets/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/System/System.Net.Sockets/Socket.cs | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/mcs/class/System/System.Net.Sockets/ChangeLog b/mcs/class/System/System.Net.Sockets/ChangeLog index 71576113b37..fdfae71d2ad 100644 --- a/mcs/class/System/System.Net.Sockets/ChangeLog +++ b/mcs/class/System/System.Net.Sockets/ChangeLog @@ -1,3 +1,9 @@ +2002-08-20 Dick Porter <dick@ximian.com> + + * Socket.cs: Fix deadlock when the AsyncResult callback calls + End*(). Set the async request's worker property so it can return + results. These two fixes combined fix bug 28092. + 2002-06-24 Dick Porter <dick@ximian.com> * Socket.cs: Make SetSocketOption cope with boolean values (they diff --git a/mcs/class/System/System.Net.Sockets/Socket.cs b/mcs/class/System/System.Net.Sockets/Socket.cs index 3f1785381fd..85c72df0d84 100644 --- a/mcs/class/System/System.Net.Sockets/Socket.cs +++ b/mcs/class/System/System.Net.Sockets/Socket.cs @@ -132,8 +132,8 @@ namespace System.Net.Sockets } private void End() { - callback(result); ((ManualResetEvent)result.AsyncWaitHandle).Set(); + callback(result); result.IsCompleted=true; } @@ -445,6 +445,7 @@ namespace System.Net.Sockets object state) { SocketAsyncResult req=new SocketAsyncResult(state); Worker worker=new Worker(this, callback, req); + req.Worker=worker; Thread child=new Thread(new ThreadStart(worker.Accept)); child.Start(); return(req); @@ -456,6 +457,7 @@ namespace System.Net.Sockets SocketAsyncResult req=new SocketAsyncResult(state); Worker worker=new Worker(this, end_point, callback, req); + req.Worker=worker; Thread child=new Thread(new ThreadStart(worker.Connect)); child.Start(); return(req); @@ -469,6 +471,7 @@ namespace System.Net.Sockets SocketAsyncResult req=new SocketAsyncResult(state); Worker worker=new Worker(this, buffer, offset, size, socket_flags, callback, req); + req.Worker=worker; Thread child=new Thread(new ThreadStart(worker.Receive)); child.Start(); return(req); @@ -484,6 +487,7 @@ namespace System.Net.Sockets Worker worker=new Worker(this, buffer, offset, size, socket_flags, remote_end, callback, req); + req.Worker=worker; Thread child=new Thread(new ThreadStart(worker.ReceiveFrom)); child.Start(); return(req); @@ -497,6 +501,7 @@ namespace System.Net.Sockets SocketAsyncResult req=new SocketAsyncResult(state); Worker worker=new Worker(this, buffer, offset, size, socket_flags, callback, req); + req.Worker=worker; Thread child=new Thread(new ThreadStart(worker.Send)); child.Start(); return(req); @@ -512,6 +517,7 @@ namespace System.Net.Sockets Worker worker=new Worker(this, buffer, offset, size, socket_flags, remote_end, callback, req); + req.Worker=worker; Thread child=new Thread(new ThreadStart(worker.SendTo)); child.Start(); return(req); |