diff options
| author | Martin Ridgers <[email protected]> | 2021-12-02 16:01:50 +0100 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-12-02 16:02:41 +0100 |
| commit | 4c7c5da22538bc8b11b3393418bfc057a4336769 (patch) | |
| tree | 7b89a0938c8703a8b0322522fa8ca64367cf113c | |
| parent | Only Windows-based terminals need VT100/ANSI support enabling (diff) | |
| download | zen-4c7c5da22538bc8b11b3393418bfc057a4336769.tar.xz zen-4c7c5da22538bc8b11b3393418bfc057a4336769.zip | |
Fake concrt for non-Windows platforms
| -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, |