summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 06:12:06 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:36 +0200
commitb7f5e391c0c0e94e5958a294e5d38b1dda7332cc (patch)
tree6d48062b02d6ce9ba56b188be6e6ed1840a19a34 /cpukit/rtems
parentscore: Delete redundant thread life enums (diff)
downloadrtems-b7f5e391c0c0e94e5958a294e5d38b1dda7332cc.tar.bz2
score: Add _Thread_Exit()
The goal is to make _Thread_Exit() a no-return function in follow up patches. Update #2555. Update #2626.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/taskdelete.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c
index 7a06c51eac..c0d46d8807 100644
--- a/cpukit/rtems/src/taskdelete.c
+++ b/cpukit/rtems/src/taskdelete.c
@@ -28,6 +28,7 @@ rtems_status_code rtems_task_delete(
)
{
Thread_Control *the_thread;
+ Thread_Control *executing;
Objects_Locations location;
bool previous_life_protection;
@@ -50,7 +51,13 @@ rtems_status_code rtems_task_delete(
}
#endif
- _Thread_Close( the_thread, _Thread_Executing );
+ executing = _Thread_Executing;
+
+ if ( the_thread == executing ) {
+ _Thread_Exit( executing );
+ } else {
+ _Thread_Close( the_thread, executing );
+ }
_Objects_Put( &the_thread->Object );
_Thread_Set_life_protection( previous_life_protection );