Attempts to lock the location used by this writer. Will raise an error if the location is
        already locked by another writer. Will do nothing if the location is already locked by
        this writer.

def __lock_location(self) -> None:
        """
        Attempts to lock the location used by this writer. Will raise an error if the location is
        already locked by another writer. Will do nothing if the location is already locked by
        this writer.
        """
        if not self._is_active:
            if self._location in LogdirWriter._locked_locations:
                raise RuntimeError('TensorBoard event file in directory %s with suffix %s '
                                   'is already in use. At present multiple TensoBoard file writers '
                                   'cannot write data into the same file.' % self._location)
            LogdirWriter._locked_locations.add(self._location)
            self._is_active = True