Add a new parallel looper for MemPool items to BLI_task.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Nov 2017 20:14:43 +0000 (21:14 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 23 Nov 2017 20:14:43 +0000 (21:14 +0100)
commitefb86b712d540e132fb68058b7a7fba0fc8be247
treef872d46c5860f1fc9dc079089f3081dcc9b591a5
parentb84e6dfee4a82b4142651710cbe842f8d021a861
Add a new parallel looper for MemPool items to BLI_task.

It merely uses the new thread-safe iterators system of mempool, quite
straight forward.

Note that to avoid possible confusion with two void pointers as
parameters of the callback, a dummy opaque struct pointer is used
instead for the second parameter (pointer generated by iteration over
mempool), callback functions must explicitely convert it to expected
real type.

Also added a basic gtest for this new feature.
source/blender/blenlib/BLI_task.h
source/blender/blenlib/intern/task.c
tests/gtests/blenlib/BLI_task_test.cc [new file with mode: 0644]
tests/gtests/blenlib/CMakeLists.txt