diff options
Diffstat (limited to 'cpukit/rtems/src/taskdelete.c')
-rw-r--r-- | cpukit/rtems/src/taskdelete.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cpukit/rtems/src/taskdelete.c b/cpukit/rtems/src/taskdelete.c index 5830793688..2e8381cb81 100644 --- a/cpukit/rtems/src/taskdelete.c +++ b/cpukit/rtems/src/taskdelete.c @@ -52,7 +52,15 @@ rtems_status_code rtems_task_delete( executing = _Thread_Executing; if ( the_thread == executing ) { - _Thread_Exit( executing ); + /* + * The Classic tasks are neither detached nor joinable. In case of + * self deletion, they are detached, otherwise joinable by default. + */ + _Thread_Exit( + executing, + THREAD_LIFE_TERMINATING | THREAD_LIFE_DETACHED, + NULL + ); } else { _Thread_Close( the_thread, executing ); } |