Move nonblock routine to util.