Added named thread factory to track thread states.