1 16 19 package org.apache.xml.utils; 20 21 25 public class ThreadControllerWrapper 26 { 27 28 29 static ThreadController m_tpool = new ThreadController(); 30 31 37 public static void setThreadController(ThreadController tpool) 38 { 39 m_tpool = tpool; 40 } 41 42 public static Thread runThread(Runnable runnable, int priority) 43 { 44 return m_tpool.run(runnable, priority); 45 } 46 47 public static void waitThread(Thread worker, Runnable task) 48 throws InterruptedException 49 { 50 m_tpool.waitThread(worker, task); 51 } 52 53 59 public static class ThreadController 60 { 61 62 77 public Thread run(Runnable task, int priority) 78 { 79 80 Thread t = new Thread (task); 81 82 t.start(); 83 84 return t; 87 } 88 89 98 public void waitThread(Thread worker, Runnable task) 99 throws InterruptedException 100 { 101 102 worker.join(); 104 } 105 } 106 107 } 108 | Popular Tags |