public static object getThreads() { #if FIRST_PASS return(null); #else return(java.security.AccessController.doPrivileged(ikvm.runtime.Delegates.toPrivilegedAction(delegate { java.lang.ThreadGroup root = (java.lang.ThreadGroup)mainThreadGroup; for (; ;) { java.lang.Thread[] threads = new java.lang.Thread[root.activeCount()]; if (root.enumerate(threads) == threads.Length) { return threads; } } }))); #endif }
/// <summary> /// Adds the specified Thread group to this group. </summary> /// <param name="g"> the specified Thread group to be added </param> /// <exception cref="IllegalThreadStateException"> If the Thread group has been destroyed. </exception> private void Add(ThreadGroup g) { lock (this) { if (Destroyed_Renamed) { throw new IllegalThreadStateException(); } if (Groups == null) { Groups = new ThreadGroup[4]; } else if (Ngroups == Groups.Length) { Groups = Arrays.CopyOf(Groups, Ngroups * 2); } Groups[Ngroups] = g; // This is done last so it doesn't matter in case the // thread is killed Ngroups++; } }
static Java_java_lang_Thread() { mainThreadGroup = new java.lang.ThreadGroup(java.lang.ThreadGroup.createRootGroup(), "main"); }
private Thread(System.Threading.Thread t) { thread = t; tgroup = defaultGroup; tgroup.Add(this); }
public Thread(ThreadGroup grp, string name) : this(null, grp, name) { }
/// <summary> /// Copies into the specified array references to every active subgroup in this thread group. /// </summary> public int enumerate(ThreadGroup[] list, bool recurse) { return default(int); }
/// <summary> /// Copies into the specified array references to every active subgroup in this thread group. /// </summary> public int enumerate(ThreadGroup[] list) { return default(int); }
/// <summary> /// Tests if this thread group is either the thread group argument or one of its ancestor thread groups. /// </summary> public bool parentOf(ThreadGroup g) { return default(bool); }
/// <summary> /// Tests if this thread group is either the thread group argument or one of its ancestor thread groups. /// </summary> public bool parentOf(ThreadGroup g) { return(default(bool)); }
/// <summary> /// Creates an empty Thread group that is not in any Thread group. /// This method is used to create the system Thread group. /// </summary> private ThreadGroup() // called from C code { this.Name_Renamed = "system"; this.MaxPriority_Renamed = Thread.MAX_PRIORITY; this.Parent_Renamed = null; }
/* * @throws NullPointerException if the parent argument is {@code null} * @throws SecurityException if the current thread cannot create a * thread in the specified thread group. */ private static Void CheckParentAccess(ThreadGroup parent) { parent.CheckAccess(); return(null); }
/// <summary> /// Creates a new thread group. The parent of this new group is the /// specified thread group. /// <para> /// The <code>checkAccess</code> method of the parent thread group is /// called with no arguments; this may result in a security exception. /// /// </para> /// </summary> /// <param name="parent"> the parent thread group. </param> /// <param name="name"> the name of the new thread group. </param> /// <exception cref="NullPointerException"> if the thread group argument is /// <code>null</code>. </exception> /// <exception cref="SecurityException"> if the current thread cannot create a /// thread in the specified thread group. </exception> /// <seealso cref= java.lang.SecurityException </seealso> /// <seealso cref= java.lang.ThreadGroup#checkAccess() /// @since JDK1.0 </seealso> public ThreadGroup(ThreadGroup parent, String name) : this(CheckParentAccess(parent), parent, name) { }