More progress on thread support.