Better double checked locking. Removed some locks altogether, the classes are still thread safe. But doing this optimistic caching instead of locking and volatiles. Once initialized, they should perform better than the old. And our current usages are single threaded anyway, so there is no penalty now.
Better double checked locking. Removed some locks altogether, the classes are still thread safe. But doing this optimistic caching instead of locking and volatiles. Once initialized, they should perform better than the old. And our current usages are single threaded anyway, so there is no penalty now.