提交 50a295ac 编写于 作者: G Gonzalo Paniagua Javier

Invoke the callback in separate threads

	The callbacks need to be invoked in different threads to avoid clogging
	the IO pool.

	Fixes bug #639656.
上级 1443252b
......@@ -252,7 +252,12 @@ namespace System.Net.Sockets {
}
if (callback != null)
callback (this);
ThreadPool.QueueUserWorkItem (CB, null);
}
void CB (object unused)
{
callback (this);
}
SocketAsyncCall GetDelegate (Worker worker, SocketOperation op)
......
......@@ -139,9 +139,14 @@ namespace System.Net
{
if (!callbackDone && cb != null) {
callbackDone = true;
cb (this);
ThreadPool.QueueUserWorkItem (CB, null);
}
}
void CB (object unused)
{
cb (this);
}
internal void WaitUntilComplete ()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册