YunfengGao commented on pull request #6917:
URL: https://github.com/apache/skywalking/pull/6917#issuecomment-835750133


   > Because this initialization actually is in one and only one thread of the 
premain.
   
   `synchronized` here confused me that there is a multi-threaded scenario, 
haha. 
   ```Java
   public static void initDefaultLoader() throws AgentPackageNotFoundException {
       if (DEFAULT_LOADER == null) {
           synchronized (AgentClassLoader.class) {
               if (DEFAULT_LOADER == null) {
                   DEFAULT_LOADER = new 
AgentClassLoader(PluginBootstrap.class.getClassLoader());
               }
           }
       }
   }
   ```
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to