mirror of
https://github.com/Zygo/bees.git
synced 2025-07-02 00:32:27 +02:00
task: do not allow queue loops in priority queueing mode
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>
This commit is contained in:
@ -328,6 +328,7 @@ namespace crucible {
|
|||||||
TaskState::insert(const TaskStatePtr &task)
|
TaskState::insert(const TaskStatePtr &task)
|
||||||
{
|
{
|
||||||
THROW_CHECK0(invalid_argument, 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);
|
PairLock lock(m_mutex, task->m_mutex);
|
||||||
if (!task->m_run_now) {
|
if (!task->m_run_now) {
|
||||||
task->m_run_now = true;
|
task->m_run_now = true;
|
||||||
|
Reference in New Issue
Block a user