Changeset 72c8f77 in mainline for uspace/srv/sysman/job.h


Ignore:
Timestamp:
2019-08-06T18:30:29Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
63a3276
Parents:
c2d50c8
git-author:
Michal Koutný <xm.koutny+hos@…> (2015-05-26 16:15:58)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-06 18:30:29)
Message:

sysman: Separate job closure creation and its enqueuing

  • added merge job operation
  • created test that failed with previous implementation of job closure
File:
1 edited

Legend:

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

    rc2d50c8 r72c8f77  
    3737#include "unit.h"
    3838
    39 // TODO simplify queue states
    4039/** Run state of job */
    4140typedef enum {
    42         JOB_UNQUEUED, /**< Job not in queue yet */
    43         JOB_QUEUED,
    44         JOB_DEQUEUED, /**< Job not in queue already */
     41        JOB_EMBRYO, /**< Job after creation */
     42        JOB_CLOSURED, /**< Intermmediate when closure is evaluated */
     43        JOB_PENDING, /**< Job is queued */
    4544        JOB_RUNNING,
    4645        JOB_FINISHED
     
    5453} job_retval_t;
    5554
     55struct job;
     56typedef struct job job_t;
     57
    5658struct job {
    5759        link_t job_queue;
     
    6365        /** Jobs that this job is preventing from running */
    6466        dyn_array_t blocked_jobs;
     67        /** No. of jobs that the job is actually blocking (may differ from size
     68         * of blocked_jobs for not fully merged job */
     69        size_t blocked_jobs_count;
    6570        /** No. of jobs that must finish before this job */
    6671        size_t blocking_jobs;
    6772        /** Any of blocking jobs failed */
    6873        bool blocking_job_failed;
     74        /** Job that this job was merged to */
     75        job_t *merged_into;
    6976
    7077        /** See job_state_t */
     
    7481};
    7582
    76 typedef struct job job_t;
    77 typedef job_t *job_ptr_t;
    78 
    7983extern void job_queue_init(void);
    80 extern int job_queue_add_jobs(dyn_array_t *);
     84extern int job_queue_add_closure(dyn_array_t *);
    8185extern void job_queue_process(void);
    8286
Note: See TracChangeset for help on using the changeset viewer.