You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by sh...@apache.org on 2018/09/27 05:43:52 UTC
[kylin] 01/02: KYLIN-3584 Correct lazy initialization of
DefaultScheduler.INSTANCE
This is an automated email from the ASF dual-hosted git repository.
shaofengshi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 82cf3096e5cac09eb25c217629f4e440266d3b86
Author: chao long <wa...@qq.com>
AuthorDate: Tue Sep 25 16:42:54 2018 +0800
KYLIN-3584 Correct lazy initialization of DefaultScheduler.INSTANCE
---
.../java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
index c243757..df3f6fa 100644
--- a/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
+++ b/core-job/src/main/java/org/apache/kylin/job/impl/threadpool/DefaultScheduler.java
@@ -51,7 +51,11 @@ public class DefaultScheduler implements Scheduler<AbstractExecutable>, Connecti
public static DefaultScheduler getInstance() {
if (INSTANCE == null) {
- INSTANCE = createInstance();
+ synchronized (DefaultScheduler.class) {
+ if (INSTANCE == null) {
+ INSTANCE = createInstance();
+ }
+ }
}
return INSTANCE;
}