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

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorw-flo <w-flo@users.noreply.github.com>2020-05-18 12:52:53 +0300
committerGitHub <noreply@github.com>2020-05-18 12:52:53 +0300
commit669ba26333b8efcd6f83754183c8c60b6967a081 (patch)
tree951d035721afc01b4240ee26ba69b8f8074e7e1e /mcs
parente35988adc010e0fdf779ca4a5dff833911abc955 (diff)
[corlib] Improve RuntimeThread stub (#19782)
The only call site of RuntimeThread.InitializeThreadPoolThread() is in ThreadPoolCallbackWrapper, and it needs to return a valid RuntimeThread reference to prevent a NullReferenceException later on. So return `new RuntimeThread (null)` instead of a null reference. This fixes a wine-mono crash I have encountered in "ZUSI 3 - Aerosoft Edition" (in ZusiDisplay), and it might fix mono bug #17994.
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/corlib/corert/RuntimeThread.cs2
1 files changed, 1 insertions, 1 deletions
diff --git a/mcs/class/corlib/corert/RuntimeThread.cs b/mcs/class/corlib/corert/RuntimeThread.cs
index 064aefed9d0..534d22ff782 100644
--- a/mcs/class/corlib/corert/RuntimeThread.cs
+++ b/mcs/class/corlib/corert/RuntimeThread.cs
@@ -14,7 +14,7 @@ namespace Internal.Runtime.Augments
public void ResetThreadPoolThread () {}
- public static RuntimeThread InitializeThreadPoolThread () => default;
+ public static RuntimeThread InitializeThreadPoolThread () => new RuntimeThread (null);
public static RuntimeThread Create (ParameterizedThreadStart start, int maxStackSize)
=> new RuntimeThread (new Thread (start, maxStackSize));