

def _prepare_netlock(self):
    " Replaces the trajectory's service with a LockWrapper "
    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(lock_server)
    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.start()
    self._lock.start()
    lock_wrapper = LockWrapper(self._storage_service, self._lock)
    self._traj.v_storage_service = lock_wrapper
    self._lock_wrapper = lock_wrapper

dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/environment.py MultiprocContext._prepare_netlock/VarMisuse@104/165 `url`->`lock_server`