示例#1
0
        private Tuple <bool, uint, bool, ulong>[] GetClrRuntimeThreads(int runtimeId)
        {
            ClrRuntime        clrRuntime = runtimesCache[runtimeId];
            IList <ClrThread> clrThreads = clrRuntime.Threads;

            int[] gcThreadIds = clrRuntime.EnumerateGCThreads().ToArray();
            Tuple <bool, uint, bool, ulong>[] threads = new Tuple <bool, uint, bool, ulong> [clrThreads.Count];

            for (int i = 0; i < clrThreads.Count; i++)
            {
                threads[i] = Tuple.Create(
                    gcThreadIds.Contains((int)clrThreads[i].OSThreadId),
                    clrThreads[i].OSThreadId,
                    clrThreads[i].IsFinalizer,
                    clrThreads[i].AppDomain);
            }
            return(threads);
        }
示例#2
0
 /// <summary>
 ///     Enumerates the OS thread ID of GC threads in the runtime.
 /// </summary>
 /// <returns>IEnumerable&lt;System.Int32&gt;.</returns>
 /// <inheritdoc />
 public IEnumerable <int> EnumerateGCThreads() => Runtime.EnumerateGCThreads();