According to cppreference std::thread::hardware_concurrency might return 0. It shouldn't happen usually, but there might be a rare case (maybe under some VM). When it's 0 it will underflow and we will clamp the value to the MAX_THREADS.
Refs rP25656.