summaryrefslogtreecommitdiff
path: root/java/JACE/tests/Concurrency/Condition/JoinableThreadGroup.java
blob: 908da33f9f99aecd4b3baaac3e81279bba3efde4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package JACE.tests.Concurrency.Condition;

public class JoinableThreadGroup extends ThreadGroup
{
  public JoinableThreadGroup(String name)
  {
    super(name);
  }

  public JoinableThreadGroup(ThreadGroup parent, String name)
  {
    super(parent, name);
  }

  public void join() throws InterruptedException
  {
    Thread list[] = new Thread[activeCount()];

    enumerate(list, true);

    for (int i = 0; i < list.length; i++)
      list[i].join();
  }
}