Skip to content

Commit

Permalink
Replace schedule_work with queue_work
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mechanicalamit authored Oct 7, 2023
1 parent b99354a commit a49c9ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit a49c9ba

Please sign in to comment.