diff options
| author | zy <[email protected]> | 2023-11-27 01:18:15 -0500 |
|---|---|---|
| committer | zy <[email protected]> | 2023-11-27 01:18:15 -0500 |
| commit | 28c67943e33e958ecef18cc7b6ff445a25fcca59 (patch) | |
| tree | ae58f9a9625545505dd74672dcf9131215bff7d9 /source/module/monitor_timer.c | |
| parent | 3f724a135bd8996a9769dba83baedfef932dd17c (diff) | |
workqueue fix init
Diffstat (limited to 'source/module/monitor_timer.c')
| -rw-r--r-- | source/module/monitor_timer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/module/monitor_timer.c b/source/module/monitor_timer.c index dbc57ea..ac7d5e3 100644 --- a/source/module/monitor_timer.c +++ b/source/module/monitor_timer.c @@ -27,12 +27,18 @@ unsigned char del_all_kwarg_by_pid(pid_t pid) { timer = &(kernel_wtimer_list[i]); if (TIMER_NO_KWARG(timer)) // no available kwarg { + // cancel and destroy timer.work + // make sure empty timer has no work active + cancel_work_sync(&timer->wk); + destroy_work_on_stack(&timer->wk); + if (i != kernel_wtimer_num - 1) { memcpy(timer, &kernel_wtimer_list[kernel_wtimer_num - 1], sizeof(kernel_watch_timer)); } kernel_wtimer_num--; i--; + } } return 0; |
