def _prepare_netlock(self):
        if not isinstance(self._port, compat.base_type):
            url = port_to_tcp(self._port)
            self._logger.info('Determined Server URL: `%s`' % url)
        else:
            url = self._port

        if self._lock is None:
            if hasattr(os, 'fork'):
                self._lock = ForkAwareLockerClient(url)
            else:
                self._lock = LockerClient(url)

        if self._timeout is None:
            lock_server = LockerServer(url)
        else:
            lock_server = TimeOutLockerServer(url, self._timeout)
            self._logger.info('Using timeout aware lock server.')

        self._lock_process = multip.Process(name='LockServer', target=_wrap_handling,
                                            args=(dict(handler=lock_server,
                                                       logging_manager=self._logging_manager,
                                                       graceful_exit=self._graceful_exit),))
        # self._lock_process = threading.Thread(name='LockServer', target=_wrap_handling,
        #                                       args=(dict(handler=lock_server,
        #                                       logging_manager=self._logging_manager),))

        self._lock_process.start()
        self._lock.start()
        # Wrap around the storage service to allow the placement of locks around
        # the storage procedure.
        lock_wrapper = LockWrapper(self._storage_service, self._lock)
        self._traj.v_storage_service = lock_wrapper
        self._lock_wrapper = lock_wrapper
Collect and run healthchecks, output to stdout and stderr.
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/environment.py/MultiprocContext._prepare_netlock--crossover with--dataset/ETHPy150Open python-hospital/hospital/hospital/cli.py/main