소스 검색

Replace schedule_work with queue_work

schedule_work adds work to global workqueue. In this example, we create a local workqueue. Use the local workqueue by calling queue_work(), instead of putting work on the global workqueue.
Amit Dhingra 1 년 전
부모
커밋
a49c9baffa
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      examples/sched.c

+ 1 - 1
examples/sched.c

@@ -17,7 +17,7 @@ static int __init sched_init(void)
 {
     queue = alloc_workqueue("HELLOWORLD", WQ_UNBOUND, 1);
     INIT_WORK(&work, work_handler);
-    schedule_work(&work);
+    queue_work(queue, &work);
     return 0;
 }