mirror of
https://github.com/apache/nuttx.git
synced 2025-12-09 03:33:51 +08:00
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:
committed by
Alin Jerpelea
parent
35a62b7d5e
commit
fce40edb6b
@@ -39,6 +39,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#define WDOG_ISACTIVE(w) ((w)->func != NULL)
|
||||
#define WDOG_MAX_DELAY ((CLOCK_MAX) / 2 - 1)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Type Declarations
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user