Add thread counter class.