Skip to content

Commit

Permalink
some bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
yjfnypeu committed Apr 20, 2017
1 parent 38df165 commit d06ded6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

一款简单超轻量级的线程池管理器

- 为什么会需要此
- 为什么会需要此框架


### 依赖
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@ final class CallableWrapper<T> implements Callable<T> {

@Override
public T call() throws Exception {
Tools.resetThread(Thread.currentThread(),name,callback);
if (callback != null) {
callback.onStart(Thread.currentThread());
}
Tools.resetThread(Thread.currentThread(),name,callback);
T t = proxy.call();

// avoid NullPointException
T t = proxy == null ? null : proxy.call();
if (callback != null) {
callback.onCompleted(Thread.currentThread());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ final class RunnableWrapper implements Runnable {

@Override
public void run() {
Tools.resetThread(Thread.currentThread(),name,callback);
if (callback != null) {
callback.onStart(Thread.currentThread());
}
Tools.resetThread(Thread.currentThread(),name,callback);
proxy.run();
// avoid NullPointException
if (proxy != null) {
proxy.run();
}
if (callback != null) {
callback.onCompleted(Thread.currentThread());
}
Expand Down

0 comments on commit d06ded6

Please sign in to comment.