diff options
author | Ludovic Henry <ludovic@xamarin.com> | 2015-09-10 13:32:01 +0300 |
---|---|---|
committer | Ludovic Henry <ludovic@xamarin.com> | 2015-09-10 18:59:01 +0300 |
commit | 1f4d44800ef5906435affcc301f871c64c31d67c (patch) | |
tree | afb44b138f6a65abde31e762f7c1e08c2bcc6acb /mcs | |
parent | d1f9373441e797185d8088d911cea5717282f0d9 (diff) |
[Socket] Duplicate logic of AsyncResult.ExecuteWorkItem to SocketAsyncResult
This consists in executing the callback synchronously and swallowing any exception in this callback.
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs | 6 | ||||
-rw-r--r-- | mcs/class/corlib/System/AppDomain.cs | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs b/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs index f1cd229d865..f0c4fa22b7b 100644 --- a/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs +++ b/mcs/class/System/System.Net.Sockets/SocketAsyncResult.cs @@ -307,7 +307,11 @@ namespace System.Net.Sockets async_result.Invoke (); if (completed && callback != null) { - ThreadPool.UnsafeQueueCustomWorkItem (new AsyncResult (state => callback ((IAsyncResult) state), this, false), false); + try { + callback (this); + } catch (Exception e) { + AppDomain.CurrentDomain.DoUnhandledException (e); + } } } diff --git a/mcs/class/corlib/System/AppDomain.cs b/mcs/class/corlib/System/AppDomain.cs index 569fc383bff..22927ecd2f5 100644 --- a/mcs/class/corlib/System/AppDomain.cs +++ b/mcs/class/corlib/System/AppDomain.cs @@ -1345,6 +1345,9 @@ namespace System { DomainUnload(this, null); } + [MethodImplAttribute(MethodImplOptions.InternalCall)] + internal extern void DoUnhandledException (Exception e); + internal void DoUnhandledException (UnhandledExceptionEventArgs args) { if (UnhandledException != null) UnhandledException (this, args); |