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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2020-04-09 16:51:44 +0300
committerJeroen Bakker <j.bakker@atmind.nl>2020-04-09 20:18:14 +0300
commit78f56d5582d71e001cc1326b7182aa39f9bdedec (patch)
tree4d7a1d97a4691302d912da441d072a6b511d554d /source/blender/blenlib/BLI_task.h
parent862ec829422241878b3345661476d8551935aed2 (diff)
TaskScheduler: Minor Preparations for TBB
Tasks: move priority from task to task pool {rBf7c18df4f599fe39ffc914e645e504fcdbee8636} Tasks: split task.c into task_pool.cc and task_iterator.c {rB4ada1d267749931ca934a74b14a82479bcaa92e0} Differential Revision: https://developer.blender.org/D7385
Diffstat (limited to 'source/blender/blenlib/BLI_task.h')
-rw-r--r--source/blender/blenlib/BLI_task.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h
index 83bcdff214d..898e4be5f92 100644
--- a/source/blender/blenlib/BLI_task.h
+++ b/source/blender/blenlib/BLI_task.h
@@ -73,27 +73,25 @@ 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);
-TaskPool *BLI_task_pool_create_suspended(TaskScheduler *scheduler, void *userdata);
+TaskPool *BLI_task_pool_create(TaskScheduler *scheduler, void *userdata, TaskPriority priority);
+TaskPool *BLI_task_pool_create_background(TaskScheduler *scheduler,
+ void *userdata,
+ TaskPriority priority);
+TaskPool *BLI_task_pool_create_suspended(TaskScheduler *scheduler,
+ void *userdata,
+ TaskPriority priority);
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);
+ TaskFreeFunction freedata);
void BLI_task_pool_push_from_thread(TaskPool *pool,
TaskRunFunction run,
void *taskdata,
bool free_taskdata,
- TaskPriority priority,
+ TaskFreeFunction freedata,
int thread_id);
/* work and wait until all tasks are done */
@@ -112,6 +110,9 @@ void *BLI_task_pool_userdata(TaskPool *pool);
/* optional mutex to use from run function */
ThreadMutex *BLI_task_pool_user_mutex(TaskPool *pool);
+/* Thread ID of thread that created the task pool. */
+int BLI_task_pool_creator_thread_id(TaskPool *pool);
+
/* Delayed push, use that to reduce thread overhead by accumulating
* all new tasks into local queue first and pushing it to scheduler
* from within a single mutex lock.