From 91f3560903572c3c49ae1f1b3c64989e82349880 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 15 Mar 2021 01:18:04 -0400 Subject: [PATCH 1/2] Add null check for WaitInfo --- .../System.Private.CoreLib/src/System/Threading/Thread.Mono.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mono/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs b/src/mono/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs index c1978eab5f1114..2c7c0400c63fc9 100644 --- a/src/mono/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs +++ b/src/mono/System.Private.CoreLib/src/System/Threading/Thread.Mono.cs @@ -82,7 +82,7 @@ private Thread() ~Thread() { #if TARGET_UNIX || TARGET_BROWSER - WaitSubsystem.OnThreadExiting(this); + _waitInfo?.OnThreadExiting(); #endif FreeInternal(); } From c56602a202917b09afe08c51733a8df8eb606511 Mon Sep 17 00:00:00 2001 From: Ryan Lucia Date: Mon, 15 Mar 2021 02:54:28 -0400 Subject: [PATCH 2/2] Remove OnThreadExiting static from WaitSubsystem --- .../src/System/Threading/WaitSubsystem.Unix.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/WaitSubsystem.Unix.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/WaitSubsystem.Unix.cs index bd622d9f69401b..e259f3854015eb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/WaitSubsystem.Unix.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/WaitSubsystem.Unix.cs @@ -424,10 +424,5 @@ public static void Interrupt(Thread thread) s_lock.Release(); } } - - public static void OnThreadExiting(Thread thread) - { - thread.WaitInfo.OnThreadExiting(); - } } }