diff options
Diffstat (limited to 'src/ModulusThreads.java')
| -rw-r--r-- | src/ModulusThreads.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ModulusThreads.java b/src/ModulusThreads.java new file mode 100644 index 0000000..a664249 --- /dev/null +++ b/src/ModulusThreads.java @@ -0,0 +1,33 @@ +/* */ import java.util.LinkedHashMap; +/* */ import java.util.Map; +/* */ +/* */ public class ModulusThreads +/* */ { +/* 8 */ private static Map<String, Thread> executing = new LinkedHashMap(); +/* */ +/* 10 */ public static void addThread(String key, Thread thread) { if (executing.containsKey(key)) { +/* 11 */ executing.remove(key); +/* 12 */ executing.put(key, thread); +/* */ } +/* */ +/* 15 */ executing.put(key, thread); +/* 16 */ if (!thread.isAlive()) +/* 17 */ thread.start(); } +/* */ +/* */ public static void addRunnable(String key, Runnable x) +/* */ { +/* 21 */ addThread(key, new Thread(x)); +/* */ } +/* */ public static Thread getThread(String key) { +/* 24 */ return (Thread)executing.get(key); +/* */ } +/* */ public static void removeThread(String key) { +/* 27 */ Thread temp = (Thread)executing.get(key); +/* 28 */ executing.remove(key); +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: ModulusThreads + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |