Fix task ID inconsistency in 'app/suspend'#52
Fix task ID inconsistency in 'app/suspend'#52vicLin8712 wants to merge 1 commit intosysprog21:mainfrom
Conversation
The introduction of the logger task in previous commits changed the task creation order, which caused inconsistencies in fixed task ID assignments. This commit binds the task ID directly from the creation parameter, ensuring deterministic and correct ID assignment regardless of task creation order.
|
Are we able to identify specifically which commits are referred to as 'previous commits' in the description? |
Refer to #41 mo_task_spawn() is called in mo_logger_init() and mo_logger_init() is called before the creation of costumer applications, which causes task ID error used in |
|
Thanks. I think it would be worthwhile to include these in the description. That way, it will be easier for both current reviewers and future readers to track down the code that introduced the issue we are fixing. |
Thanks for your feedback! |
Include the git commit hash properly to address the rationale. |
suspend.c|
PR set to Draft This PR is temporarily moved back to Draft status. Before proceeding, I would like to verify whether the ID inconsistency problem also occurs in other files under the app directory. |
The introduction of the logger task in previous commits changed the task creation order, which caused inconsistencies in fixed task ID assignments.
This commit binds the task ID directly from the creation parameter, ensuring deterministic and correct ID assignment regardless of task creation order.
Summary by cubic
Fixes task ID mismatches in suspend.c by using the IDs returned from mo_task_spawn instead of hardcoded indices. This makes suspend/resume deterministic even if task creation order changes (e.g., after adding the logger task).
Written for commit c514fde. Summary will update automatically on new commits.