struct work_struct work;
struct workqueue_struct* work_wq;
static void run_work(struct work_struct* work)
{
//do something
}
//創建工作隊列
work_wq = create_singlethread_workqueue("run_work_wq");
if (run_work_wq == NULL) {
LOG_ERR("create_singlethread_workqueue failed, run_work_wq == NULL \n");
goto fail;
}
INIT_WORK(&work, run_work);
//調度執行
queue_work(run_work_wq, &work);