Add thread routines.