summaryrefslogtreecommitdiff
path: root/sys/include
diff options
context:
space:
mode:
Diffstat (limited to 'sys/include')
-rw-r--r--sys/include/sys/sysctl.h5
-rw-r--r--sys/include/sys/workqueue.h21
2 files changed, 18 insertions, 8 deletions
diff --git a/sys/include/sys/sysctl.h b/sys/include/sys/sysctl.h
index 3b8d3c7..ce7510d 100644
--- a/sys/include/sys/sysctl.h
+++ b/sys/include/sys/sysctl.h
@@ -56,6 +56,11 @@
#define HW_MACHINE 7
/*
+ * List of 'proc.*' identifiers
+ */
+#define PROC_COUNT 8
+
+/*
* Option types (i.e., int, string, etc) for
* sysctl entries.
*
diff --git a/sys/include/sys/workqueue.h b/sys/include/sys/workqueue.h
index 478751d..9925f79 100644
--- a/sys/include/sys/workqueue.h
+++ b/sys/include/sys/workqueue.h
@@ -50,12 +50,18 @@ typedef void(*workfunc_t)(struct workqueue *wqp, struct work *wp);
* Represents work that may be added to a
* workqueue.
*
- * @name: Name of this work/task
- * @func: Function with work to be done
- * @cookie: Used for validating the work structure
+ * @name: Name of this work/task [i]
+ * @data: Optional data to be passed with work [p]
+ * @func: Function with work to be done [p]
+ * @cookie: Used for validating the work structure [i]
+ *
+ * Field attributes:
+ * - [i]: Used internally
+ * - [p]: Used as parameter
*/
struct work {
- const char *name;
+ char *name;
+ void *data;
workfunc_t func;
TAILQ_ENTRY(work) link;
};
@@ -81,16 +87,15 @@ struct workqueue {
size_t max_work;
ssize_t nwork;
uint16_t cookie;
- workfunc_t func;
struct proc *worktd;
struct mutex *lock;
};
-struct workqueue *workqueue_new(const char *name, workfunc_t func,
- size_t max_work, int ipl);
+struct workqueue *workqueue_new(const char *name, size_t max_work, int ipl);
-int workqueue_enq(struct workqueue *wqp, struct work *wp);
+int workqueue_enq(struct workqueue *wqp, const char *name, struct work *wp);
int workqueue_destroy(struct workqueue *wqp);
+int work_destroy(struct work *wp);
#endif /* !_KERNEL */
#endif /* !_SYS_WORKQUEUE_H_ */