Commit 4010a858 by nobodyiam

try to fix coverity bug 'Check of thread-shared field evades lock acquisition'

parent c5115833
......@@ -9,7 +9,7 @@ import com.ctrip.framework.foundation.internals.ServiceBootstrap;
* @author Jason Song(song_s@ctrip.com)
*/
public class ApolloInjector {
private static Injector s_injector;
private static volatile Injector s_injector;
private static Object lock = new Object();
private static Injector getInjector() {
......
......@@ -13,7 +13,7 @@ public abstract class Foundation {
private static final Logger logger = LoggerFactory.getLogger(Foundation.class);
private static Object lock = new Object();
private static ProviderManager s_manager;
private static volatile ProviderManager s_manager;
// Encourage early initialization and fail early if it happens.
static {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment