Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/BLI_task.h
| Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | void BLI_task_pool_push(TaskPool *pool, TaskRunFunction run, | ||||
| void *taskdata, bool free_taskdata, TaskPriority priority); | void *taskdata, bool free_taskdata, TaskPriority priority); | ||||
| void BLI_task_pool_push_from_thread(TaskPool *pool, TaskRunFunction run, | void BLI_task_pool_push_from_thread(TaskPool *pool, TaskRunFunction run, | ||||
| void *taskdata, bool free_taskdata, TaskPriority priority, int thread_id); | void *taskdata, bool free_taskdata, TaskPriority priority, int thread_id); | ||||
| /* work and wait until all tasks are done */ | /* work and wait until all tasks are done */ | ||||
| void BLI_task_pool_work_and_wait(TaskPool *pool); | void BLI_task_pool_work_and_wait(TaskPool *pool); | ||||
| /* cancel all tasks, keep worker threads running */ | /* cancel all tasks, keep worker threads running */ | ||||
| void BLI_task_pool_cancel(TaskPool *pool); | void BLI_task_pool_cancel(TaskPool *pool); | ||||
| /* stop all worker threads */ | |||||
| void BLI_task_pool_stop(TaskPool *pool); | |||||
| /* get number of threads allowed to be used by this pool */ | /* get number of threads allowed to be used by this pool */ | ||||
| int BLI_pool_get_num_threads(TaskPool *pool); | int BLI_pool_get_num_threads(TaskPool *pool); | ||||
| /* set number of threads allowed to be used by this pool */ | /* set number of threads allowed to be used by this pool */ | ||||
| void BLI_pool_set_num_threads(TaskPool *pool, int num_threads); | void BLI_pool_set_num_threads(TaskPool *pool, int num_threads); | ||||
| /* for worker threads, test if canceled */ | /* for worker threads, test if canceled */ | ||||
| bool BLI_task_pool_canceled(TaskPool *pool); | bool BLI_task_pool_canceled(TaskPool *pool); | ||||
| /* optional userdata pointer to pass along to run function */ | /* optional userdata pointer to pass along to run function */ | ||||
| void *BLI_task_pool_userdata(TaskPool *pool); | void *BLI_task_pool_userdata(TaskPool *pool); | ||||
| /* optional mutex to use from run function */ | /* optional mutex to use from run function */ | ||||
| ThreadMutex *BLI_task_pool_user_mutex(TaskPool *pool); | ThreadMutex *BLI_task_pool_user_mutex(TaskPool *pool); | ||||
| /* number of tasks done, for stats, don't use this to make decisions */ | /* number of tasks done, for stats, don't use this to make decisions */ | ||||
| size_t BLI_task_pool_tasks_done(TaskPool *pool); | size_t BLI_task_pool_tasks_todo(TaskPool *pool); | ||||
| /* Parallel for routines */ | /* Parallel for routines */ | ||||
| typedef void (*TaskParallelRangeFunc)(void *userdata, const 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); | typedef void (*TaskParallelRangeFuncEx)(void *userdata, void *userdata_chunk, const int iter, const int thread_id); | ||||
| typedef void (*TaskParallelRangeFuncFinalize)(void *userdata, void *userdata_chunk); | typedef void (*TaskParallelRangeFuncFinalize)(void *userdata, void *userdata_chunk); | ||||
| void BLI_task_parallel_range_ex( | void BLI_task_parallel_range_ex( | ||||
| int start, int stop, | int start, int stop, | ||||
| void *userdata, | void *userdata, | ||||
| Show All 36 Lines | |||||