Fix T84745: build error with TBB 2021

task_group::is_canceling() was removed.
This commit is contained in:
Brecht Van Lommel 2021-01-15 17:21:14 +01:00
parent 340529a845
commit 3732508c64
Notes: blender-bot 2023-02-14 11:01:33 +01:00
Referenced by issue #84745, Incompatible withwith tbb 2021.1.1
5 changed files with 12 additions and 10 deletions

View File

@ -951,7 +951,7 @@ class CPUDevice : public Device {
SIMD_SET_FLUSH_TO_ZERO;
for (int sample = start_sample; sample < end_sample; sample++) {
if (task.get_cancel() || task_pool.canceled()) {
if (task.get_cancel() || TaskPool::canceled()) {
if (task.need_finish_queue == false)
break;
}
@ -1249,7 +1249,7 @@ class CPUDevice : public Device {
void thread_render(DeviceTask &task)
{
if (task_pool.canceled()) {
if (TaskPool::canceled()) {
if (task.need_finish_queue == false)
return;
}
@ -1319,7 +1319,7 @@ class CPUDevice : public Device {
task.release_tile(tile);
if (task_pool.canceled()) {
if (TaskPool::canceled()) {
if (task.need_finish_queue == false)
break;
}
@ -1416,7 +1416,7 @@ class CPUDevice : public Device {
task.offset,
sample);
if (task.get_cancel() || task_pool.canceled())
if (task.get_cancel() || TaskPool::canceled())
break;
task.update_progress(NULL);

View File

@ -62,7 +62,7 @@ void TaskPool::cancel()
bool TaskPool::canceled()
{
return tbb_group.is_canceling();
return tbb::is_current_task_group_canceling();
}
/* Task Scheduler */

View File

@ -61,7 +61,7 @@ class TaskPool {
void wait_work(Summary *stats = NULL); /* work and wait until all tasks are done */
void cancel(); /* cancel all tasks and wait until they are no longer executing */
bool canceled(); /* for worker threads, test if canceled */
static bool canceled(); /* For worker threads, test if current task pool canceled. */
protected:
tbb::task_group tbb_group;

View File

@ -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);

View File

@ -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: