Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/taskqueue.h
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | enum taskqueue_callback_type { | ||||
TASKQUEUE_CALLBACK_TYPE_INIT, | TASKQUEUE_CALLBACK_TYPE_INIT, | ||||
TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, | TASKQUEUE_CALLBACK_TYPE_SHUTDOWN, | ||||
}; | }; | ||||
#define TASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT | #define TASKQUEUE_CALLBACK_TYPE_MIN TASKQUEUE_CALLBACK_TYPE_INIT | ||||
#define TASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN | #define TASKQUEUE_CALLBACK_TYPE_MAX TASKQUEUE_CALLBACK_TYPE_SHUTDOWN | ||||
#define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1 | #define TASKQUEUE_NUM_CALLBACKS TASKQUEUE_CALLBACK_TYPE_MAX + 1 | ||||
#define TASKQUEUE_NAMELEN 32 | #define TASKQUEUE_NAMELEN 32 | ||||
/* taskqueue_enqueue flags */ | |||||
#define TQFLG_FAILIF_PENDING (1 << 0) | |||||
hselasky: Name this TASKQUEUE_FAIL_IF_PENDING and TASKQUEUE_FAIL_IF_CANCELING | |||||
#define TQFLG_FAILIF_CANCELING (1 << 1) | |||||
typedef void (*taskqueue_callback_fn)(void *context); | typedef void (*taskqueue_callback_fn)(void *context); | ||||
/* | /* | ||||
* A notification callback function which is called from | * A notification callback function which is called from | ||||
* taskqueue_enqueue(). The context argument is given in the call to | * taskqueue_enqueue(). The context argument is given in the call to | ||||
* taskqueue_create(). This function would normally be used to allow the | * taskqueue_create(). This function would normally be used to allow the | ||||
* queue to arrange to run itself later (e.g., by scheduling a software | * queue to arrange to run itself later (e.g., by scheduling a software | ||||
* interrupt or waking a kernel thread). | * interrupt or waking a kernel thread). | ||||
*/ | */ | ||||
typedef void (*taskqueue_enqueue_fn)(void *context); | typedef void (*taskqueue_enqueue_fn)(void *context); | ||||
struct taskqueue *taskqueue_create(const char *name, int mflags, | struct taskqueue *taskqueue_create(const char *name, int mflags, | ||||
taskqueue_enqueue_fn enqueue, | taskqueue_enqueue_fn enqueue, | ||||
void *context); | void *context); | ||||
int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, | int taskqueue_start_threads(struct taskqueue **tqp, int count, int pri, | ||||
const char *name, ...) __printflike(4, 5); | const char *name, ...) __printflike(4, 5); | ||||
int taskqueue_start_threads_in_proc(struct taskqueue **tqp, int count, | int taskqueue_start_threads_in_proc(struct taskqueue **tqp, int count, | ||||
int pri, struct proc *p, const char *name, ...) __printflike(5, 6); | int pri, struct proc *p, const char *name, ...) __printflike(5, 6); | ||||
int taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count, | int taskqueue_start_threads_cpuset(struct taskqueue **tqp, int count, | ||||
int pri, cpuset_t *mask, const char *name, ...) __printflike(5, 6); | int pri, cpuset_t *mask, const char *name, ...) __printflike(5, 6); | ||||
int taskqueue_enqueue(struct taskqueue *queue, struct task *task); | int taskqueue_enqueue(struct taskqueue *queue, struct task *task); | ||||
int taskqueue_enqueue_flags(struct taskqueue *queue, struct task *task, | |||||
int flags); | |||||
hselaskyUnsubmitted Not Done Inline Actionsflags -> fail_flags ? hselasky: flags -> fail_flags ? | |||||
int taskqueue_enqueue_timeout(struct taskqueue *queue, | int taskqueue_enqueue_timeout(struct taskqueue *queue, | ||||
struct timeout_task *timeout_task, int ticks); | struct timeout_task *timeout_task, int ticks); | ||||
int taskqueue_enqueue_timeout_sbt(struct taskqueue *queue, | int taskqueue_enqueue_timeout_sbt(struct taskqueue *queue, | ||||
struct timeout_task *timeout_task, sbintime_t sbt, sbintime_t pr, | struct timeout_task *timeout_task, sbintime_t sbt, sbintime_t pr, | ||||
int flags); | int flags); | ||||
int taskqueue_poll_is_busy(struct taskqueue *queue, struct task *task); | int taskqueue_poll_is_busy(struct taskqueue *queue, struct task *task); | ||||
int taskqueue_cancel(struct taskqueue *queue, struct task *task, | int taskqueue_cancel(struct taskqueue *queue, struct task *task, | ||||
u_int *pendp); | u_int *pendp); | ||||
▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines |
Name this TASKQUEUE_FAIL_IF_PENDING and TASKQUEUE_FAIL_IF_CANCELING