From 85afe4ef04f327862460570fb0aa4c30afcf7cc7 Mon Sep 17 00:00:00 2001 From: Douglas Rumbaugh Date: Tue, 11 Feb 2025 17:32:10 -0500 Subject: Progress: began adding parallel merging and locking of levels --- include/framework/scheduling/Task.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'include/framework/scheduling/Task.h') 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 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(); + } } }; -- cgit v1.2.3