Skip to content

Commit

Permalink
增加 线程池名字
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangwenping committed Apr 25, 2017
1 parent eda799a commit d1e9b9b
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/


import com.snowcattle.game.thread.ThreadNameFactory;
import com.snowcattle.game.thread.worker.AbstractWork;

import java.util.concurrent.LinkedBlockingQueue;
Expand All @@ -23,6 +24,11 @@ public NonOrderedQueuePoolExecutor(int corePoolSize) {
new LinkedBlockingQueue<Runnable>());
}

public NonOrderedQueuePoolExecutor(String name, int corePoolSize) {
super(corePoolSize, corePoolSize*2, 30, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>(), new ThreadNameFactory(name));
}

public void executeWork(AbstractWork work) {
execute(work);
}
Expand Down

0 comments on commit d1e9b9b

Please sign in to comment.