summaryrefslogtreecommitdiffstats
path: root/cpukit/score
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score')
-rw-r--r--cpukit/score/include/rtems/score/interr.h3
-rw-r--r--cpukit/score/src/threadrestart.c8
2 files changed, 10 insertions, 1 deletions
diff --git a/cpukit/score/include/rtems/score/interr.h b/cpukit/score/include/rtems/score/interr.h
index 8c647f5d0f..2100c13e07 100644
--- a/cpukit/score/include/rtems/score/interr.h
+++ b/cpukit/score/include/rtems/score/interr.h
@@ -147,7 +147,8 @@ typedef enum {
INTERNAL_ERROR_GXX_KEY_ADD_FAILED,
INTERNAL_ERROR_GXX_MUTEX_INIT_FAILED,
INTERNAL_ERROR_NO_MEMORY_FOR_HEAP,
- INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR
+ INTERNAL_ERROR_CPU_ISR_INSTALL_VECTOR,
+ INTERNAL_ERROR_RESOURCE_IN_USE
} Internal_errors_Core_list;
typedef uint32_t Internal_errors_t;
diff --git a/cpukit/score/src/threadrestart.c b/cpukit/score/src/threadrestart.c
index 4b83edefb7..02371acfdb 100644
--- a/cpukit/score/src/threadrestart.c
+++ b/cpukit/score/src/threadrestart.c
@@ -47,6 +47,14 @@ static void _Thread_Make_zombie( Thread_Control *the_thread )
ISR_lock_Context lock_context;
Thread_Zombie_control *zombies = &_Thread_Zombies;
+ if ( the_thread->resource_count != 0 ) {
+ _Terminate(
+ INTERNAL_ERROR_CORE,
+ false,
+ INTERNAL_ERROR_RESOURCE_IN_USE
+ );
+ }
+
_Thread_Set_state( the_thread, STATES_ZOMBIE );
_Thread_queue_Extract_with_proxy( the_thread );
_Watchdog_Remove( &the_thread->Timer );