多个排队和工作队列

时间:2010-08-02 13:50:34

标签: linux-kernel interrupt-handling

我正在学习工作队列来编写linux内核中的下半部分。 我想知道:如果中断处理程序执行了两次(因此调用schedule_work两次),工作队列处理程序是否被调用一次或两次?

1 个答案:

答案 0 :(得分:1)

看起来您的答案在该功能的评论中。

/**
 * schedule_work - put work task in global workqueue
 * @work: job to be done
 *
 * Returns zero if @work was already on the kernel-global workqueue and
 * non-zero otherwise.
 *
 * This puts a job in the kernel-global workqueue if it was not already
 * queued and leaves it in the same position on the kernel-global
 * workqueue otherwise.
 */
int schedule_work(struct work_struct *work)
{
        return queue_work(keventd_wq, work);
}