Merge pull request #409 from Alkarex/patch-1
[mono.git] / mcs / class / System / System.Net / WebAsyncResult.cs
index 6d0a3f431ee357ef6d6b2d8b4e389889d9610066..7cc9d5e1d8bfca35b1ff1e4cc3357efcde210204 100644 (file)
@@ -51,6 +51,7 @@ namespace System.Net
                int size;
                object locker = new object ();
                public bool EndCalled;
+               public bool AsyncWriteAll;
 
                public WebAsyncResult (AsyncCallback cb, object state)
                {
@@ -138,9 +139,17 @@ namespace System.Net
                {
                        if (!callbackDone && cb != null) {
                                callbackDone = true;
-                               cb (this);
+                               if (synch)
+                                       cb (this);
+                               else
+                                       ThreadPool.QueueUserWorkItem (CB, null);
                        }
                }
+
+               void CB (object unused)
+               {
+                       cb (this);
+               }
                
                internal void WaitUntilComplete ()
                {