Permalink
Browse files

reformat

  • Loading branch information...
laforge49 committed Dec 12, 2012
1 parent 7d72881 commit c38b1e38ce032e7d732f1b168a82b3e17aab55de
Showing with 12 additions and 13 deletions.
  1. +12 −13 src/main/java/org/agilewiki/jactor/concurrent/JAThreadManager.java
@@ -26,7 +26,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import java.util.ArrayList;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Semaphore;
import java.util.concurrent.ThreadFactory;
@@ -102,20 +101,20 @@ public void run() {
while (true) {
try {
taskRequest.acquire();
- if (closing) return;
- Runnable task = tasks.poll();
- if (task != null)
- try {
- task.run();
- } catch (Exception e) {
- logException(false, "Exception thrown by a task's run method", e);
- }
+ if (closing) return;
+ Runnable task = tasks.poll();
+ if (task != null)
+ try {
+ task.run();
+ } catch (Exception e) {
+ logException(false, "Exception thrown by a task's run method", e);
+ }
} catch (InterruptedException e) {
}
}
}
};
- threads = new Thread[this.threadCount];
+ threads = new Thread[this.threadCount];
for (int c = 0; c < threadCount; c++) {
Thread t = threadFactory.newThread(runnable);
threads[c] = t;
@@ -143,7 +142,7 @@ final public void process(Runnable task) {
@Override
final public void close() {
closing = true;
- taskRequest.release(threadCount);
+ taskRequest.release(threadCount);
Thread ct = Thread.currentThread();
for (Thread t : threads) {
if (ct != t) {
@@ -158,8 +157,8 @@ final public void close() {
}
}
}
- // Release the references to the thread array...
- threads = null;
+ // Release the references to the thread array...
+ threads = null;
}
@Override

0 comments on commit c38b1e3

Please sign in to comment.