mirror of
https://github.com/Relintai/osxcross.git
synced 2025-04-11 17:32:38 +02:00
cpucount.cpp: std:🧵:hardware_concurrency() may return 0
This commit is contained in:
parent
3536634878
commit
e108c9eeb6
@ -5,7 +5,7 @@
|
|||||||
*
|
*
|
||||||
* Requires C++11 or better.
|
* Requires C++11 or better.
|
||||||
*/
|
*/
|
||||||
int main()
|
int main() {
|
||||||
{
|
unsigned int numcpus = std::thread::hardware_concurrency();
|
||||||
std::cout << std::thread::hardware_concurrency() << std::endl;
|
std::cout << (numcpus > 0 ? numcpus : 1) << std::endl;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user