aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/abstractions
diff options
context:
space:
mode:
Diffstat (limited to 'os/common/abstractions')
-rw-r--r--os/common/abstractions/nasa_osal/src/osapi.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/os/common/abstractions/nasa_osal/src/osapi.c b/os/common/abstractions/nasa_osal/src/osapi.c
index f192a35e0..a367c339b 100644
--- a/os/common/abstractions/nasa_osal/src/osapi.c
+++ b/os/common/abstractions/nasa_osal/src/osapi.c
@@ -1312,11 +1312,15 @@ int32 OS_TaskCreate(uint32 *task_id,
error code is not very appropriate but this case seems to not be
coveded by the specification.*/
if ((tp = chRegFindThreadByWorkingArea((stkalign_t *)stack_pointer)) != NULL) {
+ /* Releasing the thread reference.*/
+ chThdRelease(tp);
return OS_ERR_NO_FREE_IDS;
}
/* Checking if the name is already in use.*/
if ((tp = chRegFindThreadByName(task_name)) != NULL) {
+ /* Releasing the thread reference.*/
+ chThdRelease(tp);
return OS_ERR_NAME_TAKEN;
}
@@ -1390,6 +1394,9 @@ int32 OS_TaskDelete(uint32 task_id) {
((funcptr_t)(tp->osal_delete_handler))();
}
+ /* Releasing the thread reference.*/
+ chThdRelease(tp);
+
return OS_SUCCESS;
}
@@ -1490,6 +1497,9 @@ int32 OS_TaskSetPriority(uint32 task_id, uint32 new_priority) {
chSchRescheduleS();
chSysUnlock();
+ /* Releasing the thread reference.*/
+ chThdRelease(tp);
+
return OS_SUCCESS;
}
@@ -1549,6 +1559,9 @@ int32 OS_TaskGetIdByName(uint32 *task_id, const char *task_name) {
*task_id = (uint32)tp;
+ /* Releasing the thread reference.*/
+ chThdRelease(tp);
+
return OS_SUCCESS;
}
@@ -1585,6 +1598,9 @@ int32 OS_TaskGetInfo(uint32 task_id, OS_task_prop_t *task_prop) {
task_prop->priority = (uint32)256U - (uint32)tp->realprio;
task_prop->OStask_id = task_id;
+ /* Releasing the thread reference.*/
+ chThdRelease(tp);
+
return OS_SUCCESS;
}