diff options
| author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-07-27 13:41:27 +0200 |
|---|---|---|
| committer | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-07-27 13:41:27 +0200 |
| commit | f34d580861a5b3942ffd7f24d37ccd4a8c58b524 (patch) | |
| tree | ca20c604a3c269c6da2131c4fc7ddf520aec1757 /core/object | |
| parent | 41a7f6b38047773386710d5e49b64b173a3198de (diff) | |
| download | redot-engine-f34d580861a5b3942ffd7f24d37ccd4a8c58b524.tar.gz | |
Revert "Implement parallel foreach() for easier multithreading"
This reverts commit e28868e30cd478e878d0a8331e17e2cf90039558.
Diffstat (limited to 'core/object')
| -rw-r--r-- | core/object/worker_thread_pool.h | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/core/object/worker_thread_pool.h b/core/object/worker_thread_pool.h index 9fe8497eaf..d4d9387765 100644 --- a/core/object/worker_thread_pool.h +++ b/core/object/worker_thread_pool.h @@ -202,25 +202,4 @@ public: ~WorkerThreadPool(); }; -template <typename F> -static _FORCE_INLINE_ void for_range(int i_begin, int i_end, bool parallel, String name, F f) { - if (!parallel) { - for (int i = i_begin; i < i_end; i++) { - f(i); - } - return; - } - - auto wrapper = [&](int i, void *unused) { - f(i + i_begin); - }; - - WorkerThreadPool *wtp = WorkerThreadPool::get_singleton(); - WorkerThreadPool::GroupID gid = wtp->add_template_group_task( - &wrapper, &decltype(wrapper)::operator(), nullptr, - i_end - i_begin, -1, - true, name); - wtp->wait_for_group_task_completion(gid); -} - #endif // WORKER_THREAD_POOL_H |
