Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.HashMap;

public class Main {
    private static HashMap<String, Thread> threadPool = new HashMap<String, Thread>();

    /**
     * Interrupts/stops all threads that currently exist in threadpool
     */
    // TODO: Craig: May want to check if they are active first? Will it cause an error
    // if you try and interrupt a thread that is already interrupted?
    public static void stopAll() {
        for (Thread th : threadPool.values()) {
            th.interrupt();
        }
    }
}