diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-09 15:49:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-09 17:55:04 +0300 |
commit | 14f3b2cdad2d7b00ce3ea27bf8eb0087ac2a6cbd (patch) | |
tree | 889d20ad5cf627057bb619e18ec47d39cabafc99 /source/blender/bmesh/intern/bmesh_iterators_inline.h | |
parent | f546b0800b9121b24b1292f1ec602ed9964d1848 (diff) |
BLI_task: add TLS support to BLI_task_parallel_mempool
Support thread local storage for BLI_task_parallel_mempool,
as well as support for the reduce and free callbacks.
mempool_iter_threadsafe_* functions have been moved into a private
header thats only shared between task_iterator.c and BLI_mempool.c
so the TLS can be made part of the iterator array without having to
rely on passing in struct offsets.
Add test task.MempoolIterTLS that ensures reduce and free
are working as expected.
Reviewed By: mont29
Ref D11548
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_iterators_inline.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_iterators_inline.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/bmesh/intern/bmesh_iterators_inline.h b/source/blender/bmesh/intern/bmesh_iterators_inline.h index c384fb03cd9..81b6a58e58b 100644 --- a/source/blender/bmesh/intern/bmesh_iterators_inline.h +++ b/source/blender/bmesh/intern/bmesh_iterators_inline.h @@ -188,18 +188,18 @@ BLI_INLINE void BM_iter_parallel(BMesh *bm, const char itype, TaskParallelMempoolFunc func, void *userdata, - const bool use_threading) + const TaskParallelSettings *settings) { /* inlining optimizes out this switch when called with the defined type */ switch ((BMIterType)itype) { case BM_VERTS_OF_MESH: - BLI_task_parallel_mempool(bm->vpool, userdata, func, use_threading); + BLI_task_parallel_mempool(bm->vpool, userdata, func, settings); break; case BM_EDGES_OF_MESH: - BLI_task_parallel_mempool(bm->epool, userdata, func, use_threading); + BLI_task_parallel_mempool(bm->epool, userdata, func, settings); break; case BM_FACES_OF_MESH: - BLI_task_parallel_mempool(bm->fpool, userdata, func, use_threading); + BLI_task_parallel_mempool(bm->fpool, userdata, func, settings); break; default: /* should never happen */ |