diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2025-02-11 17:32:10 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2025-02-11 17:32:10 -0500 |
| commit | 85afe4ef04f327862460570fb0aa4c30afcf7cc7 (patch) | |
| tree | aba55db313b752df4ac073db117900e0128c22fb /include/framework/scheduling/Task.h | |
| parent | c04efb2640421be7a24f851c08e290c89b7b46f2 (diff) | |
| download | dynamic-extension-85afe4ef04f327862460570fb0aa4c30afcf7cc7.tar.gz | |
Progress: began adding parallel merging and locking of levels
Diffstat (limited to 'include/framework/scheduling/Task.h')
| -rw-r--r-- | include/framework/scheduling/Task.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/framework/scheduling/Task.h b/include/framework/scheduling/Task.h index ed40d3d..2d68f56 100644 --- a/include/framework/scheduling/Task.h +++ b/include/framework/scheduling/Task.h @@ -49,9 +49,9 @@ typedef std::function<void(void *)> Job; struct Task { Task(size_t size, size_t ts, Job job, void *args, size_t type = 0, - SchedulerStatistics *stats = nullptr) + SchedulerStatistics *stats = nullptr, std::mutex *lk = nullptr) : m_job(job), m_size(size), m_timestamp(ts), m_args(args), m_type(type), - m_stats(stats) {} + m_stats(stats), m_lk(lk) {} Job m_job; size_t m_size; @@ -59,6 +59,7 @@ struct Task { void *m_args; size_t m_type; SchedulerStatistics *m_stats; + std::mutex *m_lk; friend bool operator<(const Task &self, const Task &other) { return self.m_timestamp < other.m_timestamp; @@ -87,6 +88,10 @@ struct Task { .count(); m_stats->log_time_data(time, m_type); } + + if (m_lk) { + m_lk->unlock(); + } } }; |