45#if FIRST_PASS == false
47 static AccessControllerAccessor accessControllerAccessor;
48 static ThreadAccessor threadAccessor;
50 static AccessControllerAccessor AccessControllerAccessor =>
JVM.
Internal.BaseAccessors.Get(
ref accessControllerAccessor);
52 static ThreadAccessor ThreadAccessor =>
JVM.
Internal.BaseAccessors.Get(
ref threadAccessor);
63 throw new NotImplementedException();
65 return JVM.MainThreadGroup;
70 internal static void WaitUntilLastJniThread()
73 throw new NotImplementedException();
75 int count = ThreadAccessor.InvokeIsDaemon(ThreadAccessor.InvokeCurrentThread()) ? 0 : 1;
76 while (
Interlocked.CompareExchange(
ref global::java.lang.Thread.nonDaemonCount[0], 0, 0) > count)
77 global::System.Threading.Thread.Sleep(1);
82 internal static void AttachThreadFromJni(
object threadGroup)
85 throw new NotImplementedException();
87 if (ThreadAccessor.GetCurrent() ==
null)
88 ThreadAccessor.Init(threadGroup ??
JVM.MainThreadGroup);
97 public static global::java.lang.StackTraceElement[]
getStackTrace(StackTrace stack)
100 throw new NotImplementedException();
102 var stackTrace =
new List<global::java.lang.StackTraceElement>();
104 return stackTrace.ToArray();
115 throw new NotImplementedException();
119 var root = (global::java.lang.ThreadGroup)
JVM.MainThreadGroup;
122 var threads =
new global::java.lang.Thread[root.activeCount()];
123 if (root.enumerate(threads) == threads.Length)
138 throw new NotImplementedException();
140 var stacks =
new global::java.lang.StackTraceElement[threads.Length][];
141 for (
int i = 0; i < threads.Length; i++)
143 var nativeThread = ThreadAccessor.GetNativeThread(threads[i]);
144 if (nativeThread ==
null)
146 stacks[i] = Array.Empty<global::java.lang.StackTraceElement>();
153 var suspended =
false;
154 if ((nativeThread.ThreadState & global::System.Threading.ThreadState.Suspended) == 0 && nativeThread != global::System.Threading.Thread.CurrentThread)
157 nativeThread.Suspend();
163 stack =
new StackTrace(nativeThread,
true);
168 nativeThread.Resume();
173 catch (ThreadStateException)
175 stacks[i] = Array.Empty<global::java.lang.StackTraceElement>();
178 if (nativeThread == global::System.Threading.Thread.CurrentThread)
184 stacks[i] = Array.Empty<global::java.lang.StackTraceElement>();
ExceptionHelper ExceptionHelper
Gets the ExceptionHelper associated with this instance of the runtime.