Add utils.locked decorator