From 7527cb527598aaabf0ed9b38a352edb28536392a Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 20 Apr 2012 10:22:07 +0200 Subject: manager: Transaction as an object This makes it obvious that transactions are short-lived. They are created in manager_add_job() and destroyed after the application of jobs. It also prepares for a split of the transaction code to a new source. --- src/core/job.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core/job.c') diff --git a/src/core/job.c b/src/core/job.c index 9199cf6a4b..543f37d0db 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -97,7 +97,7 @@ void job_free(Job *j) { free(j); } -JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts) { +JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool conflicts, Transaction *tr) { JobDependency *l; assert(object); @@ -118,20 +118,20 @@ JobDependency* job_dependency_new(Job *subject, Job *object, bool matters, bool if (subject) LIST_PREPEND(JobDependency, subject, subject->subject_list, l); else - LIST_PREPEND(JobDependency, subject, object->manager->transaction_anchor, l); + LIST_PREPEND(JobDependency, subject, tr->anchor, l); LIST_PREPEND(JobDependency, object, object->object_list, l); return l; } -void job_dependency_free(JobDependency *l) { +void job_dependency_free(JobDependency *l, Transaction *tr) { assert(l); if (l->subject) LIST_REMOVE(JobDependency, subject, l->subject->subject_list, l); else - LIST_REMOVE(JobDependency, subject, l->object->manager->transaction_anchor, l); + LIST_REMOVE(JobDependency, subject, tr->anchor, l); LIST_REMOVE(JobDependency, object, l->object->object_list, l); -- cgit v1.2.3-54-g00ecf