Use a re-entrant lock for scheduler jobs