[nsthread] Implement all four code variants