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 'intern/cycles/util/util_task.h')
-rw-r--r--intern/cycles/util/util_task.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/intern/cycles/util/util_task.h b/intern/cycles/util/util_task.h
index acdb2cb50a2..6b7562c2267 100644
--- a/intern/cycles/util/util_task.h
+++ b/intern/cycles/util/util_task.h
@@ -29,7 +29,7 @@ class Task;
class TaskPool;
class TaskScheduler;
-typedef boost::function<void(Task*,int)> TaskRunFunction;
+typedef boost::function<void(void)> TaskRunFunction;
/* Task
*
@@ -39,7 +39,11 @@ class Task
{
public:
Task() {};
+ Task(const TaskRunFunction& run_) : run(run_) {}
+
virtual ~Task() {}
+
+ TaskRunFunction run;
};
/* Task Pool
@@ -54,12 +58,13 @@ public:
class TaskPool
{
public:
- TaskPool(const TaskRunFunction& run);
+ TaskPool();
~TaskPool();
void push(Task *task, bool front = false);
+ void push(const TaskRunFunction& run, bool front = false);
- void wait(); /* wait until all tasks are done */
+ void wait_work(); /* work and wait until all tasks are done */
void cancel(); /* cancel all tasks, keep worker threads running */
void stop(); /* stop all worker threads */
@@ -70,8 +75,6 @@ protected:
void done_increase(int done);
- TaskRunFunction run;
-
thread_mutex done_mutex;
thread_condition_variable done_cond;
@@ -103,6 +106,7 @@ protected:
static thread_mutex mutex;
static int users;
static vector<thread*> threads;
+ static vector<int> thread_level;
static volatile bool do_exit;
static list<Entry> queue;