IKVM11  11
Java SE 11 Virtual Machine for .NET
Loading...
Searching...
No Matches
IKVM.Java.Externs.sun.management.ThreadImpl Class Reference

Static Public Member Functions

static object getThreads ()
 
static void getThreadInfo1 (long[] ids, int maxDepth, object result)
 
static long getThreadTotalCpuTime0 (long id)
 
static void getThreadTotalCpuTime1 (long[] ids, long[] result)
 
static long getThreadUserCpuTime0 (long id)
 
static void getThreadUserCpuTime1 (long[] ids, long[] result)
 
static void getThreadAllocatedMemory1 (long[] ids, long[] result)
 
static void setThreadCpuTimeEnabled0 (bool enable)
 
static void setThreadAllocatedMemoryEnabled0 (bool enable)
 
static void setThreadContentionMonitoringEnabled0 (bool enable)
 
static object findMonitorDeadlockedThreads0 ()
 
static object findDeadlockedThreads0 ()
 
static void resetPeakThreadCount0 ()
 
static object dumpThreads0 (long[] ids, bool lockedMonitors, bool lockedSynchronizers)
 
static void resetContentionTimes0 (long tid)
 

Detailed Description

Definition at line 28 of file ThreadImpl.cs.

Member Function Documentation

◆ dumpThreads0()

static object IKVM.Java.Externs.sun.management.ThreadImpl.dumpThreads0 ( long[] ids,
bool lockedMonitors,
bool lockedSynchronizers )
static

Definition at line 201 of file ThreadImpl.cs.

202 {
203 throw new System.NotImplementedException();
204 }

◆ findDeadlockedThreads0()

static object IKVM.Java.Externs.sun.management.ThreadImpl.findDeadlockedThreads0 ( )
static

Definition at line 191 of file ThreadImpl.cs.

192 {
193 throw new System.NotImplementedException();
194 }

◆ findMonitorDeadlockedThreads0()

static object IKVM.Java.Externs.sun.management.ThreadImpl.findMonitorDeadlockedThreads0 ( )
static

Definition at line 186 of file ThreadImpl.cs.

187 {
188 throw new System.NotImplementedException();
189 }

◆ getThreadAllocatedMemory1()

static void IKVM.Java.Externs.sun.management.ThreadImpl.getThreadAllocatedMemory1 ( long[] ids,
long[] result )
static

Definition at line 166 of file ThreadImpl.cs.

167 {
168 throw new System.NotImplementedException();
169 }

◆ getThreadInfo1()

static void IKVM.Java.Externs.sun.management.ThreadImpl.getThreadInfo1 ( long[] ids,
int maxDepth,
object result )
static

Definition at line 45 of file ThreadImpl.cs.

46 {
47#if !FIRST_PASS
48 System.Reflection.ConstructorInfo[] constructors = typeof(global::java.lang.management.ThreadInfo).GetConstructors(System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
49 foreach (System.Reflection.ConstructorInfo constructor in constructors)
50 {
51 if (constructor.GetParameters().Length == 9)
52 {
53 global::java.lang.Thread[] threads = (global::java.lang.Thread[])getThreads();
54 global::java.lang.management.ThreadInfo[] threadInfos = (global::java.lang.management.ThreadInfo[])result;
55 for (int i = 0; i < ids.Length; i++)
56 {
57 long id = ids[i];
58 for (int t = 0; t < threads.Length; t++)
59 {
60 if (threads[t].getId() == id)
61 {
62 global::java.lang.Thread thread = threads[t];
63
64 int state;
65 // invers to sun.misc.VM.toThreadState
66 switch (thread.getState().ordinal())
67 {
68 case (int)global::java.lang.Thread.State.__Enum.RUNNABLE:
69 state = JVMTI_THREAD_STATE_RUNNABLE;
70 break;
71 case (int)global::java.lang.Thread.State.__Enum.BLOCKED:
72 state = JVMTI_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER;
73 break;
74 case (int)global::java.lang.Thread.State.__Enum.WAITING:
75 state = JVMTI_THREAD_STATE_WAITING_INDEFINITELY;
76 break;
77 case (int)global::java.lang.Thread.State.__Enum.TIMED_WAITING:
78 state = JVMTI_THREAD_STATE_WAITING_WITH_TIMEOUT;
79 break;
80 case (int)global::java.lang.Thread.State.__Enum.TERMINATED:
81 state = JVMTI_THREAD_STATE_TERMINATED;
82 break;
83 case (int)global::java.lang.Thread.State.__Enum.NEW:
84 state = JVMTI_THREAD_STATE_ALIVE;
85 break;
86 default:
87 state = 0;
88 break;
89 }
90 //TODO set in state JMM_THREAD_STATE_FLAG_SUSPENDED if the thread is suspended
91
92 global::java.lang.StackTraceElement[] stacktrace = thread.getStackTrace();
93 if (maxDepth >= 0 && maxDepth < stacktrace.Length)
94 {
95 global::java.lang.StackTraceElement[] temp = new global::java.lang.StackTraceElement[maxDepth];
96 System.Array.Copy(stacktrace, temp, temp.Length);
97 stacktrace = temp;
98 }
99
100 object[] parameters = new object[9];
101 parameters[0] = thread; // thread
102 parameters[1] = state; // state
103 // lockObj
104 // lockOwner
105 parameters[4] = 0; // blockedCount
106 parameters[5] = 0; // blockedTime
107 parameters[6] = -1; // waitedCount
108 parameters[7] = 0; // waitedTime
109 parameters[8] = stacktrace; // stackTrace
110 threadInfos[i] = (global::java.lang.management.ThreadInfo)constructor.Invoke(parameters);
111 break;
112 }
113 }
114 }
115 return;
116 }
117 }
118 throw new global::java.lang.InternalError("Constructor for java.lang.management.ThreadInfo not find.");
119#endif
120 }

◆ getThreads()

static object IKVM.Java.Externs.sun.management.ThreadImpl.getThreads ( )
static

Definition at line 31 of file ThreadImpl.cs.

32 {
34 }
Implements the native mthods of 'java.lang.Thread'.
Definition Thread.cs:43
static object getThreads()
Implements the native method 'getThreads'.
Definition Thread.cs:112

◆ getThreadTotalCpuTime0()

static long IKVM.Java.Externs.sun.management.ThreadImpl.getThreadTotalCpuTime0 ( long id)
static

Definition at line 130 of file ThreadImpl.cs.

131 {
132 if (id == 0)
133 {
134 int currentId = GetCurrentThreadId();
135 System.Diagnostics.ProcessThreadCollection threads = System.Diagnostics.Process.GetCurrentProcess().Threads;
136 foreach (System.Diagnostics.ProcessThread t in threads)
137 {
138 if (t.Id == currentId)
139 {
140 return (long)(t.TotalProcessorTime.Ticks * 100);
141 }
142 }
143 return 0;
144 }
145 else
146 {
147 throw new System.NotImplementedException("Only current Thread is supported.");
148 }
149 }

◆ getThreadTotalCpuTime1()

static void IKVM.Java.Externs.sun.management.ThreadImpl.getThreadTotalCpuTime1 ( long[] ids,
long[] result )
static

Definition at line 151 of file ThreadImpl.cs.

152 {
153 throw new System.NotImplementedException();
154 }

◆ getThreadUserCpuTime0()

static long IKVM.Java.Externs.sun.management.ThreadImpl.getThreadUserCpuTime0 ( long id)
static

Definition at line 156 of file ThreadImpl.cs.

157 {
158 throw new System.NotImplementedException();
159 }

◆ getThreadUserCpuTime1()

static void IKVM.Java.Externs.sun.management.ThreadImpl.getThreadUserCpuTime1 ( long[] ids,
long[] result )
static

Definition at line 161 of file ThreadImpl.cs.

162 {
163 throw new System.NotImplementedException();
164 }

◆ resetContentionTimes0()

static void IKVM.Java.Externs.sun.management.ThreadImpl.resetContentionTimes0 ( long tid)
static

Definition at line 206 of file ThreadImpl.cs.

207 {
208 throw new System.NotImplementedException();
209 }

◆ resetPeakThreadCount0()

static void IKVM.Java.Externs.sun.management.ThreadImpl.resetPeakThreadCount0 ( )
static

Definition at line 196 of file ThreadImpl.cs.

197 {
198 throw new System.NotImplementedException();
199 }

◆ setThreadAllocatedMemoryEnabled0()

static void IKVM.Java.Externs.sun.management.ThreadImpl.setThreadAllocatedMemoryEnabled0 ( bool enable)
static

Definition at line 176 of file ThreadImpl.cs.

177 {
178 throw new System.NotImplementedException();
179 }

◆ setThreadContentionMonitoringEnabled0()

static void IKVM.Java.Externs.sun.management.ThreadImpl.setThreadContentionMonitoringEnabled0 ( bool enable)
static

Definition at line 181 of file ThreadImpl.cs.

182 {
183 throw new System.NotImplementedException();
184 }

◆ setThreadCpuTimeEnabled0()

static void IKVM.Java.Externs.sun.management.ThreadImpl.setThreadCpuTimeEnabled0 ( bool enable)
static

Definition at line 171 of file ThreadImpl.cs.

172 {
173 //ignoring, we need nothing to enable
174 }

The documentation for this class was generated from the following file: