Implements the native method 'dumpThreads'.
136 {
137#if FIRST_PASS
138 throw new NotImplementedException();
139#else
140 var stacks = new global::java.lang.StackTraceElement[threads.Length][];
141 for (int i = 0; i < threads.Length; i++)
142 {
143 var nativeThread = ThreadAccessor.GetNativeThread(threads[i]);
144 if (nativeThread == null)
145 {
146 stacks[i] = Array.Empty<global::java.lang.StackTraceElement>();
147 }
148 else
149 {
150#if NETFRAMEWORK
151 try
152 {
153 var suspended = false;
154 if ((nativeThread.ThreadState & global::System.Threading.ThreadState.Suspended) == 0 && nativeThread != global::System.Threading.Thread.CurrentThread)
155 {
156 suspended = true;
157 nativeThread.Suspend();
158 }
159
161 try
162 {
164 }
165 finally
166 {
167 if (suspended)
168 nativeThread.Resume();
169 }
170
172 }
173 catch (ThreadStateException)
174 {
175 stacks[i] = Array.Empty<global::java.lang.StackTraceElement>();
176 }
177#else
178 if (nativeThread == global::System.Threading.Thread.CurrentThread)
179 {
181 }
182 else
183 {
184 stacks[i] = Array.Empty<global::java.lang.StackTraceElement>();
185 }
186#endif
187 }
188 }
189
190 return stacks;
191#endif
192 }
static global::java.lang.StackTraceElement[] getStackTrace(StackTrace stack)
Implements the native method 'getStackTrace'.