Merge commit from fork

Fixed issue where thread could get a higher priority than the module's value for max priority.
This commit is contained in:
Frédéric Desbiens
2025-09-28 21:15:19 +01:00
committed by GitHub

View File

@@ -1,5 +1,6 @@
/*************************************************************************** /***************************************************************************
* Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2024 Microsoft Corporation
* Copyright (c) 2025 Eclipse ThreadX Contributors
* *
* This program and the accompanying materials are made available under the * This program and the accompanying materials are made available under the
* terms of the MIT License which is available at * 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
ALIGN_TYPE return_value; ALIGN_TYPE return_value;
if (param_1 < module_instance -> txm_module_instance_maximum_priority)
{
return(TX_THRESH_ERROR);
}
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION) if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
{ {
if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD))) 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
ALIGN_TYPE return_value; ALIGN_TYPE return_value;
if (param_1 < module_instance -> txm_module_instance_maximum_priority)
{
return(TX_PRIORITY_ERROR);
}
if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION) if (module_instance -> txm_module_instance_property_flags & TXM_MODULE_MEMORY_PROTECTION)
{ {
if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD))) if (!TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, param_0, sizeof(TX_THREAD)))