简单使用:
(1)定义:
struct delayed_work test_delaywork;
(2)初始化
INIT_DELAYED_WORK(&test_delaywork , test_delaywork_func);
(3)实现回调函数
static void test_delaywork_func(struct work_struct *work)
{
printk("delaywork running\n");
}
(4)调用delaywork
schedule_delayed_work(&test_delaywork , msecs_to_jiffies(200));
(5)取消delaywork
cancel_delayed_work_sync(&test_delaywork );
阅读(2592) | 评论(0) | 转发(0) |