[minor] add locking to scheduler