1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-27 14:37:16 +00:00

rogueviz:: added CAP_THREAD guard

This commit is contained in:
Zeno Rogue 2022-09-29 15:13:30 +02:00
parent ac088d1d41
commit 31318862cb

View File

@ -357,6 +357,7 @@ namespace objmodels {
/* parallelize a computation */
inline int threads = 1;
#if CAP_THREAD
template<class T> auto parallelize(long long N, T action) -> decltype(action(0,0)) {
if(threads == 1) return action(0,N);
std::vector<std::thread> v;
@ -371,6 +372,7 @@ namespace objmodels {
for(Res r: results) res += r;
return res;
}
#endif
}