diff options
Diffstat (limited to 'ports/linux/gnu/src/tx_thread_interrupt_control.c')
| -rw-r--r-- | ports/linux/gnu/src/tx_thread_interrupt_control.c | 87 |
1 files changed, 41 insertions, 46 deletions
diff --git a/ports/linux/gnu/src/tx_thread_interrupt_control.c b/ports/linux/gnu/src/tx_thread_interrupt_control.c index 657cf72e..75b62511 100644 --- a/ports/linux/gnu/src/tx_thread_interrupt_control.c +++ b/ports/linux/gnu/src/tx_thread_interrupt_control.c @@ -1,18 +1,19 @@ /*************************************************************************** - * Copyright (c) 2024 Microsoft Corporation - * + * Copyright (c) 2024 Microsoft Corporation + * Copyright (c) 2026-present Eclipse ThreadX contributors + * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. - * + * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ -/** */ -/** ThreadX Component */ +/** */ +/** ThreadX Component */ /** */ /** Thread */ /** */ @@ -47,53 +48,47 @@ VOID _tx_thread_interrupt_restore(UINT previous_posture) } -/**************************************************************************/ -/* */ -/* FUNCTION RELEASE */ -/* */ -/* _tx_thread_interrupt_control Linux/GNU */ +/**************************************************************************/ +/* */ +/* FUNCTION RELEASE */ +/* */ +/* _tx_thread_interrupt_control Linux/GNU */ /* 6.1 */ /* AUTHOR */ /* */ /* William E. Lamie, Microsoft Corporation */ /* */ /* DESCRIPTION */ -/* */ -/* This function is responsible for changing the interrupt lockout */ -/* posture of the system. */ -/* */ -/* INPUT */ -/* */ -/* new_posture New interrupt lockout posture */ -/* */ -/* OUTPUT */ -/* */ -/* old_posture Old interrupt lockout posture */ -/* */ -/* CALLS */ -/* */ -/* tx_linux_mutex_lock */ -/* pthread_self */ -/* pthread_getschedparam */ -/* tx_linux_mutex_recursive_unlock */ -/* pthread_exit */ -/* */ -/* CALLED BY */ -/* */ -/* Application Code */ -/* */ -/* RELEASE HISTORY */ -/* */ -/* DATE NAME DESCRIPTION */ /* */ -/* 09-30-2020 William E. Lamie Initial Version 6.1 */ +/* This function is responsible for changing the interrupt lockout */ +/* posture of the system. */ +/* */ +/* INPUT */ +/* */ +/* new_posture New interrupt lockout posture */ +/* */ +/* OUTPUT */ +/* */ +/* old_posture Old interrupt lockout posture */ +/* */ +/* CALLS */ +/* */ +/* tx_linux_mutex_lock */ +/* pthread_self */ +/* pthread_getschedparam */ +/* tx_linux_mutex_recursive_unlock */ +/* pthread_exit */ +/* */ +/* CALLED BY */ +/* */ +/* Application Code */ /* */ /**************************************************************************/ UINT _tx_thread_interrupt_control(UINT new_posture) { UINT old_posture; -TX_THREAD *thread_ptr; +TX_THREAD *thread_ptr; pthread_t thread_id; int exit_code = 0; @@ -107,18 +102,18 @@ int exit_code = 0; /* Pickup the current thread pointer. */ thread_ptr = _tx_thread_current_ptr; - /* Determine if this is a thread and it does not + /* Determine if this is a thread and it does not match the current thread pointer. */ - if ((_tx_linux_threadx_thread) && - ((!thread_ptr) || (!pthread_equal(thread_ptr -> tx_thread_linux_thread_id, thread_id)))) - { + if ((_tx_linux_threadx_thread) && + ((!thread_ptr) || (!pthread_equal(thread_ptr -> tx_thread_linux_thread_id, thread_id)))) + { - /* This indicates the Linux thread was actually terminated by ThreadX is only + /* This indicates the Linux thread was actually terminated by ThreadX is only being allowed to run in order to cleanup its resources. */ /* Unlock linux mutex. */ tx_linux_mutex_recursive_unlock(_tx_linux_mutex); pthread_exit((void *)&exit_code); - } + } /* Determine the current interrupt lockout condition. */ if (tx_linux_mutex_recursive_count == 1) @@ -155,7 +150,7 @@ int exit_code = 0; _tx_linux_global_int_disabled_flag = TX_TRUE; } } - else if (thread_ptr) + else if (thread_ptr) { /* Determine how to apply the new posture. */ |
