]> git.hungrycats.org Git - bees/commitdiff
task: do not allow queue loops in priority queueing mode
authorZygo Blaxell <bees@furryterror.org>
Sun, 12 Jan 2025 20:17:21 +0000 (15:17 -0500)
committerZygo Blaxell <bees@furryterror.org>
Sun, 12 Jan 2025 20:28:26 +0000 (15:28 -0500)
Tasks using non-priority FIFO dependency tracking can insert themselves
into their own queue, to run the Task again immediately after it exits.

For priority queues, this attempts to splice the post-exec queue into
itself, which doesn't seem like a good idea.

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
lib/task.cc

index d0b58948cc41d694b5505d5d8e14c9776574e5c0..679a7141748573c95b58680a1322a4db71e2b583 100644 (file)
@@ -328,6 +328,7 @@ namespace crucible {
        TaskState::insert(const TaskStatePtr &task)
        {
                THROW_CHECK0(invalid_argument, task);
+               THROW_CHECK2(invalid_argument, m_id, task->m_id, m_id != task->m_id);
                PairLock lock(m_mutex, task->m_mutex);
                if (!task->m_run_now) {
                        task->m_run_now = true;