Skip to content

Commit 9dbc34b

Browse files
committed
Fix thread delete issue.
1 parent 31707b4 commit 9dbc34b

File tree

7 files changed

+16
-35
lines changed

7 files changed

+16
-35
lines changed

build_version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
extern "C" {
1313
#endif
1414

15-
#define ATOS_BUILD_TIME "2025-02-16,16:45"
16-
#define ATOS_COMMIT_HEAD_ID "0deb96be7fb60b90b237f26d1f11a3ecbb793618"
15+
#define ATOS_BUILD_TIME "2025-02-22,09:47"
16+
#define ATOS_COMMIT_HEAD_ID "31707b4d07edfbcf810af056dc4f828080c67eef"
1717
#define ATOS_VERSION_MAJOR_NUMBER (2u)
1818
#define ATOS_VERSION_MINOR_NUMBER (0u)
19-
#define ATOS_VERSION_PATCH_NUMBER (21u)
19+
#define ATOS_VERSION_PATCH_NUMBER (22u)
2020

2121
#define ATOS_VERSION_MAJOR_NUMBER_MASK (0x03FFu)
2222
#define ATOS_VERSION_MAJOR_NUMBER_POS (22u)

include/at_rtos.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,23 +1126,6 @@ static inline b_t os_id_is_invalid(struct os_id id)
11261126
}
11271127
#endif
11281128

1129-
/**
1130-
* @brief Set the unique id to invalid.
1131-
*
1132-
* @param id The provided unique id.
1133-
*/
1134-
#if (OS_ID_NODATA)
1135-
static inline void os_id_set_invalid(void *id)
1136-
{
1137-
id = NULL;
1138-
}
1139-
#else
1140-
static inline void os_id_set_invalid(struct os_id id)
1141-
{
1142-
kernel_os_id_set_invalid(id);
1143-
}
1144-
#endif
1145-
11461129
/**
11471130
* @brief The kernel OS start to run.
11481131
*/
@@ -1299,10 +1282,8 @@ typedef struct {
12991282

13001283
#if (OS_ID_NODATA)
13011284
b_t (*id_isInvalid)(void *);
1302-
void (*id_setInvalid)(void *);
13031285
#else
13041286
b_t (*id_isInvalid)(struct os_id);
1305-
void (*id_setInvalid)(struct os_id);
13061287
#endif
13071288
i32p_t (*schedule_run)(void);
13081289
b_t (*schedule_is_running)(void);

include/k_type.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,4 @@ static inline _b_t kernel_os_id_is_invalid(struct os_id id)
9292
return false;
9393
}
9494

95-
static inline void kernel_os_id_set_invalid(struct os_id id)
96-
{
97-
id.p_val = NULL;
98-
}
99-
10095
#endif /* _K_TYPE_H_ */

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "At-RTOS",
33
"homepage": "https://github.com/At-EC/At-RTOS",
4-
"version": "2.0.21",
5-
"timestamp": "2025-02-16,16:45",
6-
"commit_id": "0904090025c37df497c72b1b7f6ca038e3054e1f"
4+
"version": "2.0.22",
5+
"timestamp": "2025-02-22,09:47",
6+
"commit_id": "0deb96be7fb60b90b237f26d1f11a3ecbb793618"
77
}

source/k_malloc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void k_free(void *p_addr)
113113
return;
114114
}
115115

116-
if ((_u32_t)p_addr >= (_u32_t)(void *)&g_os_heap_mem[sizeof(g_os_heap_mem)]) {
116+
if ((_u32_t)p_addr > (_u32_t)(void *)&g_os_heap_mem[sizeof(g_os_heap_mem) / sizeof(_u32_t) - 1]) {
117117
return;
118118
}
119119

@@ -193,7 +193,7 @@ _b_t k_allocated(void *p_addr)
193193
return false;
194194
}
195195

196-
if ((_u32_t)p_addr >= (_u32_t)(void *)&g_os_heap_mem[sizeof(g_os_heap_mem)]) {
196+
if ((_u32_t)p_addr > (_u32_t)(void *)&g_os_heap_mem[sizeof(g_os_heap_mem) / sizeof(_u32_t) - 1]) {
197197
return false;
198198
}
199199

source/k_thread.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ const at_rtos_api_t os = {
8888
.subscribe_data_is_ready = os_subscribe_data_is_ready,
8989

9090
.id_isInvalid = os_id_is_invalid,
91-
.id_setInvalid = os_id_set_invalid,
9291
.schedule_run = os_kernel_run,
9392
.schedule_is_running = os_kernel_is_running,
9493
.schedule_lock = os_kernel_lock,

source/sched_kernel.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,13 @@ _i32p_t schedule_exit_trigger(struct schedule_task *pTask, void *pHoldCtx, void
208208

209209
if (immediately) {
210210
timeout_set(&pTask->expire, timeout_ms, true);
211-
_schedule_transfer_toTargetList((linker_t *)&pTask->linker, pToList);
211+
if (pToList) {
212+
_schedule_transfer_toTargetList((linker_t *)&pTask->linker, pToList);
213+
} else {
214+
pTask->exec.exit.pToList = pToList;
215+
pTask->exec.exit.timeout_ms = timeout_ms;
216+
_schedule_transfer_toExitList((linker_t *)&pTask->linker);
217+
}
212218
} else {
213219
pTask->exec.exit.pToList = pToList;
214220
pTask->exec.exit.timeout_ms = timeout_ms;
@@ -237,7 +243,7 @@ _b_t schedule_hasTwoPendingItem(void)
237243
return false;
238244
}
239245

240-
if (!g_kernel_rsc.sch_pend_list.pHead->pNext) {
246+
if (g_kernel_rsc.sch_pend_list.pHead->pNext) {
241247
return true;
242248
}
243249

0 commit comments

Comments
 (0)