def acquire_lock(self, path=None):
        """Acquire an exclusive lock on the currently-loaded session data."""
        if path is None:
            path = self._get_file_path()
        path += self.LOCK_SUFFIX
        checker = locking.LockChecker(self.id, self.lock_timeout)
        while not checker.expired():
            lock = FileLock(path)
            timeout = 0.1
            try:
                lock.acquire(timeout=timeout)
                self.lock = lock
                break
            except Timeout:
                time.sleep(timeout)
        self.locked = True
        if self.debug:
            cherrypy.log('Lock acquired.', 'TOOLS.SESSIONS')
Acquire an exclusive lock on the currently-loaded session data.
cherrypy/lib/sessions.py