mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-11-07 01:03:00 +00:00
rogueviz:: added CAP_THREAD guard
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user