diff options
| -rw-r--r-- | zen/chunk/chunk.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/zen/chunk/chunk.cpp b/zen/chunk/chunk.cpp index 866372654..e4dfd2a36 100644 --- a/zen/chunk/chunk.cpp +++ b/zen/chunk/chunk.cpp @@ -33,6 +33,48 @@ ////////////////////////////////////////////////////////////////////////// +#if ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC + +namespace Concurrency +{ + +template <typename IterType, typename LambdaType> void +parallel_for_each(IterType Cursor, IterType End, const LambdaType& Lambda) +{ + for (; Cursor < End; ++Cursor) + { + Lambda(*Cursor); + } +} + +template <typename T> +struct combinable +{ + T& local() + { + return Value; + } + + template <typename LambdaType> void combine_each(const LambdaType& Lambda) + { + Lambda(Value); + } + + T Value = {}; +}; + +struct task_group +{ + void run(...) {} + void wait() {} +}; + +} // namespace Concurrency + +#endif // ZEN_PLATFORM_LINUX || ZEN_PLATFORM_MAC + +////////////////////////////////////////////////////////////////////////// + namespace detail { static const uint32_t buzhashTable[] = { 0x458be752, 0xc10748cc, 0xfbbcdbb8, 0x6ded5b68, 0xb10a82b5, 0x20d75648, 0xdfc5665f, 0xa8428801, 0x7ebf5191, 0x841135c7, 0x65cc53b3, |