Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Kotas <jkotas@microsoft.com>2018-03-23 08:18:16 +0300
committerGitHub <noreply@github.com>2018-03-23 08:18:16 +0300
commited61762299551768ea1bddbb97e36417f83db921 (patch)
treee04276d9f449e902d19e83baa1960134787f67e9 /src
parent57082a666f42246d85938c9a0919da1237c7628c (diff)
Handle null execution context in threadpool callback (#5605)
Fixes #5603
Diffstat (limited to 'src')
-rw-r--r--src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs b/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs
index eb5debcf1..b7b2932cf 100644
--- a/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs
+++ b/src/System.Private.CoreLib/src/System/Threading/Win32ThreadPoolNativeOverlapped.cs
@@ -191,6 +191,12 @@ namespace System.Threading
Debug.Assert(!data._completed);
data._completed = true;
+ if (data._executionContext == null)
+ {
+ data._callback(errorCode, bytesWritten, ToNativeOverlapped(overlapped));
+ return;
+ }
+
ContextCallback callback = s_executionContextCallback;
if (callback == null)
s_executionContextCallback = callback = OnExecutionContextCallback;