0
我正在學習工作隊列來編寫linux內核中的下半部分。我想知道:如果中斷處理程序執行了兩次(因此調用schedule_work
兩次),工作隊列處理程序會被調用一次還是兩次?多個排隊和工作隊列
我正在學習工作隊列來編寫linux內核中的下半部分。我想知道:如果中斷處理程序執行了兩次(因此調用schedule_work
兩次),工作隊列處理程序會被調用一次還是兩次?多個排隊和工作隊列
看起來像你的答案是在該函數的評論。
/**
* 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);
}