diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-02-25 14:22:55 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-02-25 14:22:55 +0000 |
commit | 3e6e47ee7dfea369d865bef41dc59e7fbdff6e8a (patch) | |
tree | 9b2fc48e06c0b712d04707734c8e056e0cbb559a /os/common/abstractions | |
parent | fde2a2cc60934f77816a4d2200b97127cdb3a6d2 (diff) | |
download | ChibiOS-3e6e47ee7dfea369d865bef41dc59e7fbdff6e8a.tar.gz ChibiOS-3e6e47ee7dfea369d865bef41dc59e7fbdff6e8a.tar.bz2 ChibiOS-3e6e47ee7dfea369d865bef41dc59e7fbdff6e8a.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8947 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/common/abstractions')
-rw-r--r-- | os/common/abstractions/nasa_osal/src/osapi.c | 16 |
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;
}
|