Skip to content

Commit

Permalink
fix the bug in task suspend
Browse files Browse the repository at this point in the history
  • Loading branch information
Mculover666 committed Mar 23, 2022
1 parent 21d994a commit 565cd29
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kernel/core/include/tos_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
// patch is updated for patch changes/bug fixes that should not need user code changes

#define TOS_VERSION_MAJOR 0x02
#define TOS_VERSION_MINOR 0x04
#define TOS_VERSION_PATCH 0x05
#define TOS_VERSION "2.4.5"
#define TOS_VERSION_MINOR 0x05
#define TOS_VERSION_PATCH 0x00
#define TOS_VERSION "2.5.0"

#endif /* _TOS_VERSION_H_ */

6 changes: 6 additions & 0 deletions kernel/core/tos_task.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,12 @@ __API__ k_err_t tos_task_suspend(k_task_t *task)
if (task_state_is_ready(task)) { // kill the good kid
readyqueue_remove(task);
}
if (task_state_is_pending(task)) {
pend_list_remove(task);
}
if (task_state_is_sleeping(task)) {
tick_list_remove(task);
}
task_state_set_suspended(task);

TOS_CPU_INT_ENABLE();
Expand Down

0 comments on commit 565cd29

Please sign in to comment.