diff options
author | Hans Goudey <h.goudey@me.com> | 2021-01-15 20:04:53 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2021-01-15 20:04:53 +0300 |
commit | 3459f75f5b31e155bf549ec70dd2476dc810077e (patch) | |
tree | 528e2b713707176258630106953002252b397dde /source/blender/blenlib | |
parent | 237e27e161c9ac3c6b9d74dae1cafb5ea55c0458 (diff) | |
parent | 0b0e45252b11bbc1c0d96a3e04a4087d02f765e3 (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/BLI_task.h | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/task_pool.cc | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenlib/BLI_task.h b/source/blender/blenlib/BLI_task.h index a3805f71316..9e61686b37a 100644 --- a/source/blender/blenlib/BLI_task.h +++ b/source/blender/blenlib/BLI_task.h @@ -105,8 +105,10 @@ void BLI_task_pool_work_and_wait(TaskPool *pool); /* cancel all tasks, keep worker threads running */ void BLI_task_pool_cancel(TaskPool *pool); -/* for worker threads, test if canceled */ -bool BLI_task_pool_canceled(TaskPool *pool); +/* for worker threads, test if current task pool canceled. this function may + * only be called from worker threads and pool must be the task pool that the + * thread is currently executing a task from. */ +bool BLI_task_pool_current_canceled(TaskPool *pool); /* optional userdata pointer to pass along to run function */ void *BLI_task_pool_user_data(TaskPool *pool); diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc index dfed24da2d9..4b545c5647e 100644 --- a/source/blender/blenlib/intern/task_pool.cc +++ b/source/blender/blenlib/intern/task_pool.cc @@ -268,7 +268,7 @@ static bool tbb_task_pool_canceled(TaskPool *pool) { #ifdef WITH_TBB if (pool->use_threads) { - return pool->tbb_group.is_canceling(); + return tbb::is_current_task_group_canceling(); } #else UNUSED_VARS(pool); @@ -520,7 +520,7 @@ void BLI_task_pool_cancel(TaskPool *pool) } } -bool BLI_task_pool_canceled(TaskPool *pool) +bool BLI_task_pool_current_canceled(TaskPool *pool) { switch (pool->type) { case TASK_POOL_TBB: |