| As part of the work to ensure thread safety for environments, a ThreadLocalSingleton module was introduced, which allows the creation of thread local singletons when mixed in. That work made use of the module in a couple places where it was obviously needed, but there are other places in the Puppet code base where we create singletons. We should evaluate where these singletons are used and determine if they should also use the module. It is likely always safe to extend the module, but it is probably not always necessary. One outcome of this ticket might be to decide that it should always be used any time a singleton is being created, for safety and consistency. Otherwise, the inclusion of the module will indicate when the singleton is used in an unsafe manner when running multithreaded. |