WORKQUEUE(9) | NetBSD Kernel Developer's Manual | WORKQUEUE(9) |
int
workqueue_create(struct workqueue **wqp, const char *name, void (*func)(struct work *, void *), void *arg, pri_t prio, int ipl, int flags);
void
workqueue_enqueue(struct workqueue *wq, struct work *wk, struct cpu_info *ci);
void
workqueue_destroy(struct workqueue *wq);
workqueue_create() creates a workqueue. It takes the following arguments:
workqueue_enqueue() enqueues the work wk into the workqueue wq.
If the WQ_PERCPU flag was set on workqueue creation, the ci argument may be used to specify the CPU on which the work should be enqueued. Also it may be NULL, then work will be enqueued on the current CPU. If WQ_PERCPU flag was not set, ci must be NULL.
The enqueued work will be processed in a thread context. A work must not be enqueued again until the callback is called by the workqueue framework.
workqueue_destroy() destroys a workqueue and frees associated resources. The caller should ensure that the workqueue has no work enqueued beforehand.
August 3, 2009 | NetBSD 5.99 |