Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1069700
  • 博文数量: 252
  • 博客积分: 4561
  • 博客等级: 上校
  • 技术积分: 2833
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-15 08:23
文章分类

全部博文(252)

文章存档

2015年(2)

2014年(1)

2013年(1)

2012年(16)

2011年(42)

2010年(67)

2009年(87)

2008年(36)

分类: LINUX

2008-05-11 20:16:59

#include <linux/module.h>
#include <linux/init.h>
#include <linux/workqueue.h>

static void handle(struct work_struct *work)
{
        printk(KERN_ALERT "this is workqueue\n");
}

struct work_struct mywork = __WORK_INITIALIZER(mywork, handle);

static int __init sky_init(void)
{
        schedule_work(&mywork);

        printk(KERN_ALERT "hello china\n");

        return 0;
}

static void __exit sky_exit(void)
{
        return;
}

MODULE_LICENSE("GPL");

module_init(sky_init);
module_exit(sky_exit);

阅读(748) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~