diff --git a/sched/task/task_recover.c b/sched/task/task_recover.c index 60bacf10494..cd5ec15a77e 100644 --- a/sched/task/task_recover.c +++ b/sched/task/task_recover.c @@ -72,7 +72,7 @@ void nxtask_recover(FAR struct tcb_s *tcb) /* The task is being deleted. Cancel in pending timeout events. */ - wd_recover(tcb); + wd_cancel(&tcb->waitdog); /* If the thread holds semaphore counts or is waiting for a semaphore * count, then release the counts. diff --git a/sched/wdog/CMakeLists.txt b/sched/wdog/CMakeLists.txt index 6337bf96090..e38a78e368e 100644 --- a/sched/wdog/CMakeLists.txt +++ b/sched/wdog/CMakeLists.txt @@ -21,4 +21,4 @@ # ############################################################################## target_sources(sched PRIVATE wd_initialize.c wd_start.c wd_cancel.c - wd_gettime.c wd_recover.c) + wd_gettime.c) diff --git a/sched/wdog/Make.defs b/sched/wdog/Make.defs index 2af39ebb6f0..e3fbbe4004a 100644 --- a/sched/wdog/Make.defs +++ b/sched/wdog/Make.defs @@ -20,7 +20,7 @@ # ############################################################################ -CSRCS += wd_initialize.c wd_start.c wd_cancel.c wd_gettime.c wd_recover.c +CSRCS += wd_initialize.c wd_start.c wd_cancel.c wd_gettime.c # Include wdog build support diff --git a/sched/wdog/wd_recover.c b/sched/wdog/wd_recover.c deleted file mode 100644 index 8c1db1db67a..00000000000 --- a/sched/wdog/wd_recover.c +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** - * sched/wdog/wd_recover.c - * - * SPDX-License-Identifier: Apache-2.0 - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -#include -#include -#include -#include - -#include "wdog/wdog.h" - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: wd_recover - * - * Description: - * This function is called from nxtask_recover() when a task is deleted via - * task_delete() or via pthread_cancel(). It checks if the deleted task - * is waiting for a timed event and if so cancels the timeout - * - * Input Parameters: - * tcb - The TCB of the terminated task or thread - * - * Returned Value: - * None. - * - * Assumptions: - * This function is called from task deletion logic in a safe context. - * - ****************************************************************************/ - -void wd_recover(FAR struct tcb_s *tcb) -{ - /* The task is being deleted. If it is waiting for any timed event, then - * cancel the watchdog now so that no events occur after the watchdog - * expires. Obviously there are lots of race conditions here so this will - * most certainly have to be revisited in the future. - * - */ - - wd_cancel(&tcb->waitdog); -} diff --git a/sched/wdog/wdog.h b/sched/wdog/wdog.h index b2b76434002..29de1667fe0 100644 --- a/sched/wdog/wdog.h +++ b/sched/wdog/wdog.h @@ -98,28 +98,6 @@ clock_t wd_timer(clock_t ticks, bool noswitches); void wd_timer(clock_t ticks); #endif -/**************************************************************************** - * Name: wd_recover - * - * Description: - * This function is called from nxtask_recover() when a task is deleted via - * task_delete() or via pthread_cancel(). It checks if the deleted task - * is waiting for a timed event and if so cancels the timeout - * - * Input Parameters: - * tcb - The TCB of the terminated task or thread - * - * Returned Value: - * None. - * - * Assumptions: - * This function is called from task deletion logic in a safe context. - * - ****************************************************************************/ - -struct tcb_s; -void wd_recover(FAR struct tcb_s *tcb); - #undef EXTERN #ifdef __cplusplus }