Skip to content

Commit 372e71f

Browse files
authored
Merge commit from fork
Fixed issue where thread could get a higher priority than the module's value for max priority.
2 parents ca7589c + da0985e commit 372e71f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

common_modules/module_manager/inc/txm_module_manager_dispatch.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/***************************************************************************
2-
* Copyright (c) 2024 Microsoft Corporation
2+
* Copyright (c) 2024 Microsoft Corporation
3+
* Copyright (c) 2025 Eclipse ThreadX Contributors
34
*
45
* This program and the accompanying materials are made available under the
56
* terms of the MIT License which is available at
@@ -2389,6 +2390,11 @@ static ALIGN_TYPE _txm_module_manager_tx_thread_preemption_change_dispatch(TXM_M
23892390

23902391
ALIGN_TYPE return_value;
23912392

2393+
if (param_1 < module_instance -> txm_module_instance_maximum_priority)
2394+
{
2395+
return(TX_THRESH_ERROR);
2396+
}
2397+
23922398
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
23932399
{
23942400
if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD)))
@@ -2418,6 +2424,11 @@ static ALIGN_TYPE _txm_module_manager_tx_thread_priority_change_dispatch(TXM_MOD
24182424

24192425
ALIGN_TYPE return_value;
24202426

2427+
if (param_1 < module_instance -> txm_module_instance_maximum_priority)
2428+
{
2429+
return(TX_PRIORITY_ERROR);
2430+
}
2431+
24212432
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
24222433
{
24232434
if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD)))

0 commit comments

Comments
 (0)