Skip to content

Commit

Permalink
optimize codes
Browse files Browse the repository at this point in the history
  • Loading branch information
wyouflf committed Apr 6, 2016
1 parent 3d46237 commit a7a2148
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public final class DownloadManager {
ColumnConverterFactory.registerColumnConverter(DownloadState.class, new DownloadStateConverter());
}

private static DownloadManager instance;
private static volatile DownloadManager instance;

private final static int MAX_DOWNLOAD_THREAD = 2; // 有效的值范围[1, 3], 设置为3时, 可能阻塞图片加载.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public final class TaskControllerImpl implements TaskController {
private TaskControllerImpl() {
}

private static TaskController instance;
private static volatile TaskController instance;

public static void registerInstance() {
if (instance == null) {
Expand Down
2 changes: 1 addition & 1 deletion xutils/src/main/java/org/xutils/http/HttpManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public final class HttpManagerImpl implements HttpManager {

private static final Object lock = new Object();
private static HttpManagerImpl instance;
private static volatile HttpManagerImpl instance;

private HttpManagerImpl() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public final class ImageManagerImpl implements ImageManager {

private static final Object lock = new Object();
private static ImageManagerImpl instance;
private static volatile ImageManagerImpl instance;

private ImageManagerImpl() {
}
Expand Down
2 changes: 1 addition & 1 deletion xutils/src/main/java/org/xutils/view/ViewInjectorImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public final class ViewInjectorImpl implements ViewInjector {
}

private static final Object lock = new Object();
private static ViewInjectorImpl instance;
private static volatile ViewInjectorImpl instance;

private ViewInjectorImpl() {
}
Expand Down

0 comments on commit a7a2148

Please sign in to comment.