def METHOD_NAME(self) -> None:
    """Acquire the lock, if possible.
    If the lock is in use, check again every *delay* seconds.
    Continue until lock acquired or *timeout* expires.
    """
    start_time = time.perf_counter()
    while True:
        try:
            self.lock = os.open(self.lockfile, os.O_CREAT|os.O_EXCL|os.O_RDWR)
        except (FileExistsError, PermissionError) as exc:
            if self.timeout is None:
                raise SConsLockFailure(
                    f"Could not acquire lock on {self.file!r}"
                ) from exc
            if (time.perf_counter() - start_time) > self.timeout:
                raise SConsLockFailure(
                    f"Timeout waiting for lock on {self.file!r}."
                ) from exc
            time.sleep(self.delay)
        else:
            if not self.writer:
                # reader: waits to get lock, but doesn't hold it
                self.release_lock()
            break