Name
flush_workqueue — ensure that any scheduled work has run to completion.
Synopsis
void fastcallflush_workqueue(
| struct workqueue_struct * |
wq); |
Description
Forces execution of the workqueue and blocks until its completion. This is typically used in driver shutdown handlers.
This function will sample each workqueue's current insert_sequence number and will sleep until the head sequence is greater than or equal to that. This means that we sleep until all works which were queued on entry have been handled, but we are not livelocked by new incoming ones.
This function used to run the workqueues itself. Now we just wait for the helper threads to do it.
本文介绍Linux内核中flush_workqueue函数的功能与实现原理。该函数用于确保所有已调度的工作完成执行,通常应用于设备驱动程序的关闭处理程序中。通过监控工作队列的序列号来等待所有已排队的工作项处理完毕。
327

被折叠的 条评论
为什么被折叠?



