ChibiOS  21.6.0
chjobs.h File Reference

Jobs Queues structures and macros. More...

Go to the source code of this file.

Data Structures

struct  ch_jobs_queue
 Type of a jobs queue. More...
 
struct  ch_job_descriptor
 Type of a job descriptor. More...
 

Macros

#define MSG_JOB_NULL   ((msg_t)-2)
 Dispatcher return code in case of a JOB_NUL has been received. More...
 

Typedefs

typedef struct ch_jobs_queue jobs_queue_t
 Type of a jobs queue. More...
 
typedef void(* job_function_t) (void *arg)
 Type of a job function. More...
 
typedef struct ch_job_descriptor job_descriptor_t
 Type of a job descriptor. More...
 

Functions

static void chJobObjectInit (jobs_queue_t *jqp, size_t jobsn, job_descriptor_t *jobsbuf, msg_t *msgbuf)
 Initializes a jobs queue object. More...
 
static job_descriptor_tchJobGet (jobs_queue_t *jqp)
 Allocates a free job object. More...
 
static job_descriptor_tchJobGetI (jobs_queue_t *jqp)
 Allocates a free job object. More...
 
static job_descriptor_tchJobGetTimeoutS (jobs_queue_t *jqp, sysinterval_t timeout)
 Allocates a free job object. More...
 
static job_descriptor_tchJobGetTimeout (jobs_queue_t *jqp, sysinterval_t timeout)
 Allocates a free job object. More...
 
static void chJobPostI (jobs_queue_t *jqp, job_descriptor_t *jp)
 Posts a job object. More...
 
static void chJobPostS (jobs_queue_t *jqp, job_descriptor_t *jp)
 Posts a job object. More...
 
static void chJobPost (jobs_queue_t *jqp, job_descriptor_t *jp)
 Posts a job object. More...
 
static void chJobPostAheadI (jobs_queue_t *jqp, job_descriptor_t *jp)
 Posts an high priority job object. More...
 
static void chJobPostAheadS (jobs_queue_t *jqp, job_descriptor_t *jp)
 Posts an high priority job object. More...
 
static void chJobPostAhead (jobs_queue_t *jqp, job_descriptor_t *jp)
 Posts an high priority job object. More...
 
static msg_t chJobDispatch (jobs_queue_t *jqp)
 Waits for a job then executes it. More...
 
static msg_t chJobDispatchTimeout (jobs_queue_t *jqp, sysinterval_t timeout)
 Waits for a job then executes it. More...
 

Detailed Description

Jobs Queues structures and macros.

This module implements queues of generic jobs to be delegated asynchronously to a pool of dedicated threads. Operations defined for Jobs Queues

  • Get: An job object is taken from the pool of the available jobs.
  • Post: A job is posted to the queue, it will be returned to the pool after execution.

Definition in file chjobs.h.