Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/BLI_task.h')
-rw-r--r--source/blender/blenlib/BLI_task.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h
index 780b0bfbbd6..63a07957336 100644
--- a/source/blender/blenlib/BLI_task.h
+++ b/source/blender/blenlib/BLI_task.h
@@ -74,10 +74,15 @@ typedef enum TaskPriority {
typedef struct TaskPool TaskPool;
typedef void (*TaskRunFunction)(TaskPool *__restrict pool, void *taskdata, int threadid);
+typedef void (*TaskFreeFunction)(TaskPool *__restrict pool, void *taskdata, int threadid);
TaskPool *BLI_task_pool_create(TaskScheduler *scheduler, void *userdata);
+TaskPool *BLI_task_pool_create_background(TaskScheduler *scheduler, void *userdata);
void BLI_task_pool_free(TaskPool *pool);
+void BLI_task_pool_push_ex(
+ TaskPool *pool, TaskRunFunction run, void *taskdata,
+ bool free_taskdata, TaskFreeFunction freedata, TaskPriority priority);
void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run,
void *taskdata, bool free_taskdata, TaskPriority priority);
@@ -107,17 +112,20 @@ ThreadMutex *BLI_task_pool_user_mutex(TaskPool *pool);
size_t BLI_task_pool_tasks_done(TaskPool *pool);
/* Parallel for routines */
-typedef void (*TaskParallelRangeFunc)(void *userdata, int iter);
+typedef void (*TaskParallelRangeFunc)(void *userdata, const int iter);
+typedef void (*TaskParallelRangeFuncEx)(void *userdata, void *userdata_chunk, const int iter, const int thread_id);
void BLI_task_parallel_range_ex(
int start, int stop,
void *userdata,
- TaskParallelRangeFunc func,
- const int range_threshold,
+ void *userdata_chunk,
+ const size_t userdata_chunk_size, TaskParallelRangeFuncEx func_ex,
+ const bool use_threading,
const bool use_dynamic_scheduling);
void BLI_task_parallel_range(
int start, int stop,
void *userdata,
- TaskParallelRangeFunc func);
+ TaskParallelRangeFunc func,
+ const bool use_threading);
#ifdef __cplusplus
}