Changeset 81c4e6ec in mainline for uspace/srv/sysman/job.c


Ignore:
Timestamp:
2020-07-05T20:46:27Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Parents:
a73aaec1
git-author:
Matthieu Riolo <matthieu.riolo@…> (2020-07-05 20:37:10)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2020-07-05 20:46:27)
Message:

removing adt/array and replace it with adt/list in sysman

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/job.c

    ra73aaec1 r81c4e6ec  
    7070        job->unit = u;
    7171
    72         array_initialize(&job->blocked_jobs, job_t *);
     72        list_initialize(&job->blocked_jobs);
    7373        job->blocking_jobs = 0;
    7474        job->blocking_job_failed = false;
     
    120120        assert(!link_used(&job->job_queue));
    121121
    122         array_foreach(job->blocked_jobs, job_t *, job_it) {
    123                 job_del_ref(&(*job_it));
    124         }
    125         array_destroy(&job->blocked_jobs);
     122        while (!list_empty(&job->blocked_jobs)) {
     123                job_link_t *job_it = list_pop(&job->blocked_jobs, job_link_t, link);
     124                job_del_ref(&job_it->job);
     125                free(job_it);
     126        }
    126127
    127128        free(job);
     
    256257
    257258        /* First remove references, then clear the array */
    258         assert(job->blocked_jobs.size == job->blocked_jobs_count);
    259         array_foreach(job->blocked_jobs, job_t *, job_it) {
    260                 job_unblock(*job_it, job);
    261         }
    262         array_clear(&job->blocked_jobs);
     259        assert(list_count(&job->blocked_jobs) == job->blocked_jobs_count);
     260
     261        while (!list_empty(&job->blocked_jobs)) {
     262                job_link_t *job_it = list_pop(&job->blocked_jobs, job_link_t, link);
     263                job_unblock(job_it->job, job);
     264                free(job_it);
     265        }
    263266
    264267        /* Add reference for event handler */
Note: See TracChangeset for help on using the changeset viewer.