Skip to content

Commit a49c9ba

Browse files
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.
1 parent b99354a commit a49c9ba

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/sched.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static int __init sched_init(void)
1717
{
1818
queue = alloc_workqueue("HELLOWORLD", WQ_UNBOUND, 1);
1919
INIT_WORK(&work, work_handler);
20-
schedule_work(&work);
20+
queue_work(queue, &work);
2121
return 0;
2222
}
2323

0 commit comments

Comments
 (0)