MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_work_init

Function rt_work_init

components/drivers/ipc/workqueue.c:191–204  ·  view source on GitHub ↗

* @brief Initialize a work item, binding with a callback function. * * @param work is a pointer to the work item object. * * @param work_func is a callback function that will be called when this work item is executed. * * @param work_data is a user data passed to the callback function as the second parameter. */

Source from the content-addressed store, hash-verified

189 * @param work_data is a user data passed to the callback function as the second parameter.
190 */
191void rt_work_init(struct rt_work *work,
192 void (*work_func)(struct rt_work *work, void *work_data),
193 void *work_data)
194{
195 RT_ASSERT(work != RT_NULL);
196 RT_ASSERT(work_func != RT_NULL);
197
198 rt_list_init(&(work->list));
199 work->work_func = work_func;
200 work->work_data = work_data;
201 work->workqueue = RT_NULL;
202 work->flags = 0;
203 work->type = 0;
204}
205
206/**
207 * @brief Create a work queue with a thread inside.

Callers 15

rt_delayed_work_initFunction · 0.85
lwp_teardownFunction · 0.85
rt_bypass_lower_registerFunction · 0.85
rt_sdhci_init_hostFunction · 0.85
timer_callbackFunction · 0.85
rt_wlan_workqueue_doworkFunction · 0.85
rt_wlan_cyclic_checkFunction · 0.85
rt_soft_rtc_set_sourceFunction · 0.85
do_work_testFunction · 0.85
do_delay_work_testFunction · 0.85
cancle_work_test01Function · 0.85

Calls 1

rt_list_initFunction · 0.85

Tested by

no test coverage detected