{{theTime}}

Search This Blog

Total Pageviews

How to thread safe public static methods using locks

How to thread safe public static methods:
If any third party public methods which are not thread safe, create global locks.

Sample Code:
static Object internalLock = new Object() ;
synchronize(internalLock){
  call public API;
}

No comments:

java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport

SpringBoot Error: java.lang.NoSuchFieldError: Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.j...