diff options
author | Yves-Alexis Perez <corsac@corsac.net> | 2012-06-28 21:16:07 +0200 |
---|---|---|
committer | Yves-Alexis Perez <corsac@corsac.net> | 2012-06-28 21:16:07 +0200 |
commit | b34738ed08c2227300d554b139e2495ca5da97d6 (patch) | |
tree | 62f33b52820f2e49f0e53c0f8c636312037c8054 /src/libstrongswan/processing/jobs/job.h | |
parent | 0a9d51a49042a68daa15b0c74a2b7f152f52606b (diff) | |
download | vyos-strongswan-b34738ed08c2227300d554b139e2495ca5da97d6.tar.gz vyos-strongswan-b34738ed08c2227300d554b139e2495ca5da97d6.zip |
Imported Upstream version 4.6.4
Diffstat (limited to 'src/libstrongswan/processing/jobs/job.h')
-rw-r--r-- | src/libstrongswan/processing/jobs/job.h | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/src/libstrongswan/processing/jobs/job.h b/src/libstrongswan/processing/jobs/job.h index 0f1c16ebe..d25cee03e 100644 --- a/src/libstrongswan/processing/jobs/job.h +++ b/src/libstrongswan/processing/jobs/job.h @@ -23,11 +23,32 @@ #define JOB_H_ typedef struct job_t job_t; +typedef enum job_priority_t job_priority_t; #include <library.h> /** - * Job-Interface as it is stored in the job queue. + * Priority classes of jobs + */ +enum job_priority_t { + /** Critical infrastructure jobs that should always been served */ + JOB_PRIO_CRITICAL = 0, + /** Short jobs executed with highest priority */ + JOB_PRIO_HIGH, + /** Default job priority */ + JOB_PRIO_MEDIUM, + /** Low priority jobs with thread blocking operations */ + JOB_PRIO_LOW, + JOB_PRIO_MAX +}; + +/** + * Enum names for job priorities + */ +extern enum_name_t *job_priority_names; + +/** + * Job interface as it is stored in the job queue. */ struct job_t { @@ -41,12 +62,19 @@ struct job_t { void (*execute) (job_t *this); /** + * Get the priority of a job. + * + * @return job priority + */ + job_priority_t (*get_priority)(job_t *this); + + /** * Destroy a job. * * Is only called whenever a job was not executed (e.g. due daemon shutdown). * After execution, jobs destroy themself. */ - void (*destroy) (job_t *job); + void (*destroy) (job_t *this); }; #endif /** JOB_H_ @}*/ |