Removed the initialization caller check from the timer change service, so tx_timer_change can now be called from tx_application_define like the other timer services - #730
Open
fdesbiens wants to merge 1 commit into
Conversation
…, so tx_timer_change can now be called from tx_application_define like the other timer services _txe_timer_change rejected any call made while the system state was TX_INITIALIZE_IN_PROGRESS or above, which made the timer API inconsistent: tx_timer_create, tx_timer_activate and tx_timer_deactivate are all callable from initialization, and tx_timer_change was callable from an ISR but not from tx_application_define. The restriction had no technical basis. _tx_timer_change only writes the expiration fields of a timer that is not on an active list, and it does so with interrupts disabled, so calling it during initialization is as safe as calling it from a thread. Applications that needed this had to either build with TX_DISABLE_ERROR_CHECKING or patch the check out. Dropped the check in both the common and the common_smp copies, removed the now unused tx_initialize.h and tx_thread.h includes along with the TX_CALLER_ERROR entry in the function header, and added an initialization time tx_timer_change call to the regression test control code so the behaviour is covered by the timer simple test in both suites. Fixes eclipse-threadx#224 Assisted-by: Copilot (Opus 5) <noreply@github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_txe_timer_changereturnedTX_CALLER_ERRORfor any call made while the system state wasTX_INITIALIZE_IN_PROGRESSor above, sotx_timer_changewas the only timer service that could not be called fromtx_application_define.tx_timer_create,tx_timer_activateandtx_timer_deactivateare all allowed there, andtx_timer_changewas even allowed from an ISR, so the restriction was inconsistent as well as undocumented in its rationale.The check has no technical basis.
_tx_timer_changeonly writes the expiration fields of a timer that is not on an active list, and it does so with interrupts disabled, so calling it during initialization is exactly as safe as calling it from a thread. Applications that needed it had to build withTX_DISABLE_ERROR_CHECKINGor patch the check out locally.This removes the check from both the
commonand thecommon_smpcopies oftxe_timer_change.c, drops the now unusedtx_initialize.handtx_thread.hincludes and theTX_CALLER_ERRORentry in the function header comment, and adds an initialization-timetx_timer_changecall totestcontrol.cin both regression suites so the behaviour is covered by the timer simple test.Relaxing an error check is backward compatible: no correct application depends on receiving
TX_CALLER_ERRORhere.Verified that the new check fails on
dev(ERROR #30) and passes with the fix. Both suites are green: 116/116 SMP, 103/103 non-SMP.Fixes #224