diff options
author | Aleksey Kliger (λgeek) <alklig@microsoft.com> | 2020-01-17 05:57:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-17 05:57:54 +0300 |
commit | c1498b8d4ce83732d1bab794005cc12f8319053d (patch) | |
tree | 429fb5e24873f9068e92bf860d324fde8a0002e0 /mcs/class | |
parent | 2ba25542e3f3c396ab0b3f516d80c968b39acb23 (diff) |
[runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread (#18480)
* [runtime] NOHANDLES for ves_icall_System_Threading_Thread_GetCurrentThread
This function (and its call to mono_handle_new) was showing up in the
flamegraph for some async-heavy benchmarks
Diffstat (limited to 'mcs/class')
-rw-r--r-- | mcs/class/corlib/System.Threading/Thread.cs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mcs/class/corlib/System.Threading/Thread.cs b/mcs/class/corlib/System.Threading/Thread.cs index f5c4b314e63..7e2db6cff11 100644 --- a/mcs/class/corlib/System.Threading/Thread.cs +++ b/mcs/class/corlib/System.Threading/Thread.cs @@ -306,7 +306,13 @@ namespace System.Threading { #endif [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static Thread GetCurrentThread (); + private extern static void GetCurrentThread_icall (ref Thread thread); + + private static Thread GetCurrentThread () { + Thread thread = null; + GetCurrentThread_icall (ref thread); + return thread; + } public static Thread CurrentThread { [ReliabilityContract (Consistency.WillNotCorruptState, Cer.MayFail)] |