summaryrefslogtreecommitdiff
path: root/components/drivers/include/ipc/workqueue.h
diff options
context:
space:
mode:
authorMeco Jianting Man <[email protected]>2021-09-14 10:30:51 -0500
committerGitHub <[email protected]>2021-09-14 10:30:51 -0500
commit717120549d126b56c06be6a268945e2065a69038 (patch)
treeabd6f117aa1f5db0fd9fa12be006f4ed5230505a /components/drivers/include/ipc/workqueue.h
parent393d7f44790f9ccdc00bdff56434030160d196f7 (diff)
parent065f9586d038c52b50190a436e3d1f8101cdbf94 (diff)
Merge branch 'RT-Thread:master' into rtusingheap
Diffstat (limited to 'components/drivers/include/ipc/workqueue.h')
-rw-r--r--components/drivers/include/ipc/workqueue.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/components/drivers/include/ipc/workqueue.h b/components/drivers/include/ipc/workqueue.h
index ccbc42b226..776709a8ab 100644
--- a/components/drivers/include/ipc/workqueue.h
+++ b/components/drivers/include/ipc/workqueue.h
@@ -5,6 +5,8 @@
*
* Change Logs:
* Date Author Notes
+ * 2021-08-01 Meco Man remove rt_delayed_work_init() and rt_delayed_work structure
+ * 2021-08-14 Jackistang add comments for rt_work_init()
*/
#ifndef WORKQUEUE_H__
#define WORKQUEUE_H__
@@ -48,11 +50,6 @@ struct rt_work
struct rt_workqueue *workqueue;
};
-struct rt_delayed_work
-{
- struct rt_work work;
-};
-
#ifdef RT_USING_HEAP
/**
* WorkQueue for DeviceDriver
@@ -64,12 +61,20 @@ rt_err_t rt_workqueue_submit_work(struct rt_workqueue *queue, struct rt_work *wo
rt_err_t rt_workqueue_cancel_work(struct rt_workqueue *queue, struct rt_work *work);
rt_err_t rt_workqueue_cancel_work_sync(struct rt_workqueue *queue, struct rt_work *work);
rt_err_t rt_workqueue_cancel_all_work(struct rt_workqueue *queue);
+rt_err_t rt_workqueue_critical_work(struct rt_workqueue *queue, struct rt_work *work);
#ifdef RT_USING_SYSTEM_WORKQUEUE
rt_err_t rt_work_submit(struct rt_work *work, rt_tick_t time);
rt_err_t rt_work_cancel(struct rt_work *work);
-#endif
+#endif /* RT_USING_SYSTEM_WORKQUEUE */
+/**
+ * @brief Initialize a work item, binding with a callback function.
+ *
+ * @param work A pointer to the work item object.
+ * @param work_func A callback function that will be called when this work item is executed.
+ * @param work_data A user data passed to the callback function as the second parameter.
+ */
rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_work *work, void *work_data),
void *work_data)
{
@@ -81,10 +86,6 @@ rt_inline void rt_work_init(struct rt_work *work, void (*work_func)(struct rt_wo
work->type = 0;
}
-void rt_delayed_work_init(struct rt_delayed_work *work, void (*work_func)(struct rt_work *work,
- void *work_data), void *work_data);
-
-int rt_work_sys_workqueue_init(void);
-#endif
+#endif /* RT_USING_HEAP */
#endif