getPriority() public method

public getPriority ( ) : int
return int
 /// <summary>
 /// Create a thread.
 /// </summary>
 /// <seealso cref= ThreadFactory#newThread(java.lang.Runnable) </seealso>
 public virtual java.lang.Thread newThread(Runnable r)
 {
     java.lang.Thread thread = new java.lang.Thread(group, r, namePrefix + threadNumber.getAndIncrement(), 0);
     thread.setDaemon(isDaemon);
     if (thread.getPriority() != Thread.NORM_PRIORITY)
     {
         thread.setPriority(Thread.NORM_PRIORITY);
     }
     return(thread);
 }
Example #2
0
 private static void DumpAllJavaThreads()
 {
     Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
     java.util.Map traces = java.lang.Thread.getAllStackTraces();
     Console.WriteLine("Full thread dump IKVM.NET {0} ({1} bit):", JVM.SafeGetAssemblyVersion(Assembly.GetExecutingAssembly()), IntPtr.Size * 8);
     java.util.Iterator entries = traces.entrySet().iterator();
     while (entries.hasNext())
     {
         java.util.Map.Entry entry  = (java.util.Map.Entry)entries.next();
         java.lang.Thread    thread = (java.lang.Thread)entry.getKey();
         Console.WriteLine("\n\"{0}\"{1} prio={2} tid=0x{3:X8}", thread.getName(), thread.isDaemon() ? " daemon" : "", thread.getPriority(), thread.getId());
         Console.WriteLine("   java.lang.Thread.State: " + thread.getState());
         java.lang.StackTraceElement[] trace = (java.lang.StackTraceElement[])entry.getValue();
         for (int i = 0; i < trace.Length; i++)
         {
             Console.WriteLine("\tat {0}", trace[i]);
         }
     }
     Console.WriteLine();
 }