@staticmethod
    def _get_instance(config_filename=None):
        # May need to release forked lock.
        if ResourceAllocationManager._lock_pid != os.getpid(): # pragma no cover
            try:
                ResourceAllocationManager._lock.release()
            except threading.ThreadError:
                pass  # Not locked.
            else:
                logging.warning('RAM: released forked lock.')
            ResourceAllocationManager._lock_pid = os.getpid()

        with ResourceAllocationManager._lock:
            ram = ResourceAllocationManager._RAM
            if ram is None:
                ram = ResourceAllocationManager._RAM = \
                          ResourceAllocationManager(config_filename)
            elif ram._pid != os.getpid():  # pragma no cover
                # We're a copy from a fork.
                for allocator in ram._allocators:
                    allocator.invalidate()
                ram = ResourceAllocationManager._RAM = \
                          ResourceAllocationManager(config_filename)
            return ram
Computes the hash sum for a file
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/resource.py/ResourceAllocationManager._get_instance--crossover with--dataset/ETHPy150Open jlisee/xpkg/python/xpkg/util.py/hash_file