Ejemplo n.º 1
0
    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
    }
Ejemplo n.º 2
0
        /// <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++;
            }
        }
Ejemplo n.º 3
0
 static Java_java_lang_Thread()
 {
     mainThreadGroup = new java.lang.ThreadGroup(java.lang.ThreadGroup.createRootGroup(), "main");
 }
Ejemplo n.º 4
0
 private Thread(System.Threading.Thread t)
 {
     thread = t;
     tgroup = defaultGroup;
     tgroup.Add(this);
 }
Ejemplo n.º 5
0
 public Thread(ThreadGroup grp, string name)
     : this(null, grp, name)
 {
 }
Ejemplo n.º 6
0
 /// <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);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Copies into the specified array references to every active  subgroup in this thread group.
 /// </summary>
 public int enumerate(ThreadGroup[] list)
 {
     return default(int);
 }
Ejemplo n.º 8
0
 /// <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);
 }
Ejemplo n.º 9
0
 /// <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));
 }
Ejemplo n.º 10
0
 /// <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;
 }
Ejemplo n.º 11
0
 /*
  * @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);
 }
Ejemplo n.º 12
0
 /// <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)
 {
 }