sched/wqueue: Add max delay tick limitation.

This commit added max delay tick limitation for the workqueue.

Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
ouyangxiangzhen
2025-05-16 09:29:35 +08:00
committed by Alin Jerpelea
parent 35a62b7d5e
commit fce40edb6b
2 changed files with 3 additions and 1 deletions

View File

@@ -39,6 +39,7 @@
****************************************************************************/
#define WDOG_ISACTIVE(w) ((w)->func != NULL)
#define WDOG_MAX_DELAY ((CLOCK_MAX) / 2 - 1)
/****************************************************************************
* Public Type Declarations

View File

@@ -83,7 +83,8 @@ int work_queue_period_wq(FAR struct kwork_wqueue_s *wqueue,
clock_t expected;
bool retimer;
if (wqueue == NULL || work == NULL || worker == NULL)
if (wqueue == NULL || work == NULL || worker == NULL ||
delay > WDOG_MAX_DELAY)
{
return -EINVAL;
}