summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems/src/taskdelete.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 14:25:50 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:36 +0200
commit270394eef82ae584477cb9c443d4a5c8e67978eb (patch)
tree7cb476c1212a917454a1650c751435381c6f0b0d /cpukit/rtems/src/taskdelete.c
parentscore: Add _Thread_Exit() (diff)
downloadrtems-270394eef82ae584477cb9c443d4a5c8e67978eb.tar.bz2
score: Avoid superfluous life protection
Disable thread dispatching is enough to prevent deletion of the executing thread. There is no need for an additional life protection. Update #2555. Update #2626.
Diffstat (limited to 'cpukit/rtems/src/taskdelete.c')
-rw-r--r--cpukit/rtems/src/taskdelete.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c
index c0d46d8807..5830793688 100644
--- a/cpukit/rtems/src/taskdelete.c
+++ b/cpukit/rtems/src/taskdelete.c
@@ -30,9 +30,7 @@ rtems_status_code rtems_task_delete(
Thread_Control *the_thread;
Thread_Control *executing;
Objects_Locations location;
- bool previous_life_protection;
- previous_life_protection = _Thread_Set_life_protection( true );
the_thread = _Thread_Get( id, &location );
switch ( location ) {
@@ -60,13 +58,11 @@ rtems_status_code rtems_task_delete(
}
_Objects_Put( &the_thread->Object );
- _Thread_Set_life_protection( previous_life_protection );
return RTEMS_SUCCESSFUL;
#if defined(RTEMS_MULTIPROCESSING)
case OBJECTS_REMOTE:
_Thread_Dispatch();
- _Thread_Set_life_protection( previous_life_protection );
return RTEMS_ILLEGAL_ON_REMOTE_OBJECT;
#endif
@@ -74,7 +70,5 @@ rtems_status_code rtems_task_delete(
break;
}
- _Thread_Set_life_protection( previous_life_protection );
-
return RTEMS_INVALID_ID;
}