def get_checkpoint(_, checkpoint):
    """
Used to synchronize the checkpoint, which will be max processed id of imput data, between all processing threads. Because input data can grow realtime, we would run into problems if some threads would use a different input boundary.
        This is the value that should also be saved to last_sync tables.
        """
    try:
        _.lock.acquire()
        if _.checkpoint is None:
            _.checkpoint = checkpoint
        return _.checkpoint
    finally:
        _.lock.release()
