aboutsummaryrefslogtreecommitdiff
path: root/src/ModulusThreads.java
diff options
context:
space:
mode:
authorJoshua Rahm <joshua.rahm@colorado.edu>2015-01-30 17:11:48 -0700
committerJoshua Rahm <joshua.rahm@colorado.edu>2015-01-30 17:11:48 -0700
commit1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch)
tree926cef8cb76d46862ed2c4ec7028720611e47476 /src/ModulusThreads.java
downloadModulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz
Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2
Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip
added source
Diffstat (limited to 'src/ModulusThreads.java')
-rw-r--r--src/ModulusThreads.java33
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