Changing the sync to only sync before lazy loading the actions.
The Actionable#getActions() method only needs to be synchronized when lazy loading. After that, the synchronization is superfluous and impacts performance. Since the field is volatile, the double-check block works in JDK5+. See http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html for more in Analyzing various thread dumps, many threads and requests stall on this method waiting for the lock. Since the lock isn't necessary in most cases anyway,
Loading
Please register or sign in to comment