include/workqueue.h File Reference

Workqueue interface. More...

#include <types.h>
#include <slist.h>
#include <util.h>
#include <interrupt.h>

Go to the source code of this file.

Data Structures

struct  workqueue_task
 Task to be run from a work queue. More...
struct  workqueue
 Work queue. More...
struct  nested_workqueue
 Nested Work Queue. More...

Typedefs

typedef void(* workqueue_func_t )(struct workqueue_task *task)
 Work queue worker function.

Functions

static void workqueue_init (struct workqueue *queue)
 Initialize a work queue.
static void workqueue_task_set_work_func (struct workqueue_task *task, workqueue_func_t worker_func)
 Change the worker function of a task.
static void workqueue_task_init (struct workqueue_task *task, workqueue_func_t worker_func)
 Initialize a work queue task.
static bool workqueue_is_empty (struct workqueue *queue)
 Check if a work queue is empty.
static bool workqueue_task_is_queued (struct workqueue_task *task)
 Check if a work queue task has been queued.
bool workqueue_add_task (struct workqueue *queue, struct workqueue_task *task)
 Add task to work queue.
static struct workqueue_taskworkqueue_pop_task (struct workqueue *queue)
 Remove task from front of work queue.
static void workqueue_run_task (struct workqueue_task *task)
 Run a work queue task.
Nested Workqueues

Nested workqueues are workqueues specific to certain shared resources, for example a bus driver which can only handle one request at a time. Such drivers may create a workqueue for keeping track of tasks wanting to use the shared resource, and move them one by one into the main workqueue.

static void nested_workqueue_init (struct nested_workqueue *wq)
 Initialize a nested workqueue.
bool nested_workqueue_add_task (struct nested_workqueue *nwq, struct workqueue_task *task)
 Add task to nested work queue.
void nested_workqueue_next_task (struct nested_workqueue *nwq)
 Switch to the next task in a nested work queue.

Variables

struct workqueue main_workqueue
 The main work queue.

Detailed Description

Workqueue interface.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file workqueue.h.

Generated on Thu Apr 29 14:10:34 2010 for xplain-bc by  doxygen 1.6.3