Lines Matching full:task
34 .Nd asynchronous task execution
46 struct task {
47 STAILQ_ENTRY(task) ta_link; /* link for queue */
49 u_short ta_priority; /* priority of task in queue */
50 task_fn_t ta_func; /* task handler */
84 .Fn taskqueue_enqueue "struct taskqueue *queue" "struct task *task"
86 .Fn taskqueue_enqueue_flags "struct taskqueue *queue" "struct task *task" "int flags"
92 .Fn taskqueue_cancel "struct taskqueue *queue" "struct task *task" "u_int *pendp"
96 .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task"
111 .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t func" "void *context"
136 when a task is added to the queue,
184 its last task.
189 To add a task to the list of tasks queued on a taskqueue, call
191 with pointers to the queue and task.
192 If the task's
195 then it is simply incremented to reflect the number of times the task
198 the task is added to the list before the first task which has a lower
201 Enqueueing a task does not perform any memory allocation which makes
207 When a task is executed,
214 from the task structure is called with the value of the field
224 is called on the task pointer passed to
237 fails if the task is already scheduled for execution.
244 fails if the task is in the canceling state and
265 Otherwise, the task is scheduled for enqueueing in the future,
269 This function returns -1 if the task is being drained.
274 function is used to cancel a task.
282 If the task is currently running,
287 that waits for a running task to finish, it could look like:
289 while (taskqueue_cancel(tq, task, NULL) != 0)
290 taskqueue_drain(tq, task);
295 the caller is responsible for ensuring that the task is not re-enqueued
300 function is used to cancel the scheduled task execution.
304 function is used to wait for the task to finish, and
307 function is used to wait for the scheduled task to finish.
308 There is no guarantee that the task will not be
311 If the caller wants to put the task into a known state,
314 the caller should use out-of-band means to ensure that the task
316 For example, if the task is enqueued by an interrupt filter, then
369 is called on a task that is enqueued on a taskqueue that is blocked by
382 is discouraged, because the state of the task can not be known in advance.
410 .Fn TASK_INIT "task" "priority" "func" "context"
412 .Va task
416 macro generates an initializer for a task structure.
427 are simply copied into the task structure fields and the
474 .Ss Predefined Task Queues
517 interrupt and then enqueue a task to finish the work.