72 |
|
|
73 |
for (int i =0; i < LookupMain.max_workers; i++) { |
for (int i =0; i < LookupMain.max_workers; i++) { |
74 |
LookupWorker worker = new LookupWorker(i, this); |
LookupWorker worker = new LookupWorker(i, this); |
75 |
/*Thread t = new Thread(worker); |
threadPool.submit(worker); |
|
t.start(); |
|
|
|
|
|
workers.put(i, worker);*/ |
|
76 |
} |
} |
77 |
|
|
78 |
while (threadPool.getActiveCount() > 0) { |
while (threadPool.getActiveCount() > 0 || threadPool.getQueue().isEmpty() == false) { |
79 |
Thread.sleep(10);//wait for worker threads |
Thread.sleep(10);//wait for worker threads |
80 |
} |
} |
81 |
|
|