函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\workqueue.c Create Date:2022-07-27 10:27:25
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__cancel_work_timer

函数原型:static bool __cancel_work_timer(struct work_struct *work, bool is_dwork)

返回类型:bool

参数:

类型参数名称
struct work_struct *work
boolis_dwork
3082  DECLARE_WAIT_QUEUE_HEAD(cancel_waitq)
3086  循环
3087  ret等于ry_to_grab_pending - steal work item from worklist and disable irq*@work: work item to steal*@is_dwork: @work is a delayed_work*@flags: place to store irq state* Try to grab PENDING bit of @work. This function can handle @work in any
3107  init_wait( & wait)
3108  func等于cwt_wakefn
3109  work等于work
3113  如果work_is_canceling(work)则schedule()
3115  finish_wait( & cancel_waitq, & wait)
3117 此条件成立可能性小(为编译器优化)(ret < 0)循环
3120  mark_work_canceling(work)
3121  local_irq_restore(flags)
3127  如果can kworkers be created yet? __flush_work(work, true)
3130  clear_work_data(work)
3137  smp_mb()
3138  如果waitqueue_active -- locklessly test for waiters on the queue*@wq_head: the waitqueue to test for waiters* returns true if the wait list is not empty* NOTE: this function is lockless and requires care, incorrect usage _will___wake_up( & cancel_waitq, Convenience macros for the sake of wake_up(): , 1, work)
3141  返回:ret
调用者
名称描述
cancel_work_syncancel_work_sync - cancel a work and wait for it to finish*@work: the work to cancel* Cancel @work and wait for its execution to finish. This function* can be used even if the work re-queues itself or migrates to* another workqueue
cancel_delayed_work_syncancel_delayed_work_sync - cancel a delayed work and wait for it to finish*@dwork: the delayed work cancel* This is cancel_work_sync() for delayed works.* Return:* %true if @dwork was pending, %false otherwise.