Index: cpukit/score/include/rtems/score/thread.h
===================================================================
--- cpukit/score/include/rtems/score/thread.h	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ cpukit/score/include/rtems/score/thread.h	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -48,4 +48,6 @@
 
 struct Scheduler_Node;
+
+struct User_extensions_Iterator;
 
 #ifdef __cplusplus
@@ -900,4 +902,9 @@
 
   /**
+   * @brief LIFO list of user extensions iterators.
+   */
+  struct User_extensions_Iterator *last_user_extensions_iterator;
+
+  /**
    * @brief Variable length array of user extension pointers.
    *
Index: cpukit/score/include/rtems/score/userextimpl.h
===================================================================
--- cpukit/score/include/rtems/score/userextimpl.h	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ cpukit/score/include/rtems/score/userextimpl.h	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -20,4 +20,5 @@
 
 #include <rtems/score/userext.h>
+#include <rtems/score/isrlock.h>
 #include <rtems/score/chainimpl.h>
 #include <rtems/score/percpu.h>
@@ -37,7 +38,39 @@
 
 /**
+ * @brief Chain iterator for dynamic user extensions.
+ *
+ * Since user extensions may delete or restart the executing thread, we must
+ * clean up registered iterators.
+ *
+ * @see _User_extensions_Iterate(), _User_extensions_Destroy_iterators() and
+ *   Thread_Control::last_user_extensions_iterator.
+ */
+typedef struct User_extensions_Iterator {
+  Chain_Iterator                   Iterator;
+  struct User_extensions_Iterator *previous;
+} User_extensions_Iterator;
+
+typedef struct {
+  /**
+   * @brief Active dynamically added user extensions.
+   */
+  Chain_Control Active;
+
+  /**
+   * @brief Chain iterator registration.
+   */
+  Chain_Iterator_registry Iterators;
+
+  /**
+   * @brief Lock to protect User_extensions_List::Active and
+   * User_extensions_List::Iterators.
+   */
+  ISR_LOCK_MEMBER( Lock )
+} User_extensions_List;
+
+/**
  * @brief List of active extensions.
  */
-extern Chain_Control _User_extensions_List;
+extern User_extensions_List _User_extensions_List;
 
 /**
@@ -154,9 +187,11 @@
  *
  * @param[in, out] arg The argument passed to the visitor.
- * @param[in] visitor is the visitor for each extension.
+ * @param[in] visitor The visitor for each extension.
+ * @param[in] direction The iteration direction for dynamic extensions.
  */
 void _User_extensions_Iterate(
-  void                    *arg,
-  User_extensions_Visitor  visitor
+  void                     *arg,
+  User_extensions_Visitor   visitor,
+  Chain_Iterator_direction  direction
 );
 
@@ -172,5 +207,9 @@
   User_extensions_Thread_create_context ctx = { created, true };
 
-  _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor );
+  _User_extensions_Iterate(
+    &ctx,
+    _User_extensions_Thread_create_visitor,
+    CHAIN_ITERATOR_FORWARD
+  );
 
   return ctx.ok;
@@ -181,5 +220,6 @@
   _User_extensions_Iterate(
     deleted,
-    _User_extensions_Thread_delete_visitor
+    _User_extensions_Thread_delete_visitor,
+    CHAIN_ITERATOR_BACKWARD
   );
 }
@@ -189,5 +229,6 @@
   _User_extensions_Iterate(
     started,
-    _User_extensions_Thread_start_visitor
+    _User_extensions_Thread_start_visitor,
+    CHAIN_ITERATOR_FORWARD
   );
 }
@@ -197,5 +238,6 @@
   _User_extensions_Iterate(
     restarted,
-    _User_extensions_Thread_restart_visitor
+    _User_extensions_Thread_restart_visitor,
+    CHAIN_ITERATOR_FORWARD
   );
 }
@@ -205,5 +247,6 @@
   _User_extensions_Iterate(
     executing,
-    _User_extensions_Thread_begin_visitor
+    _User_extensions_Thread_begin_visitor,
+    CHAIN_ITERATOR_FORWARD
   );
 }
@@ -240,5 +283,6 @@
   _User_extensions_Iterate(
     executing,
-    _User_extensions_Thread_exitted_visitor
+    _User_extensions_Thread_exitted_visitor,
+    CHAIN_ITERATOR_FORWARD
   );
 }
@@ -252,5 +296,9 @@
   User_extensions_Fatal_context ctx = { source, is_internal, error };
 
-  _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor );
+  _User_extensions_Iterate(
+    &ctx,
+    _User_extensions_Fatal_visitor,
+    CHAIN_ITERATOR_BACKWARD
+  );
 }
 
@@ -261,6 +309,42 @@
   _User_extensions_Iterate(
     executing,
-    _User_extensions_Thread_terminate_visitor
-  );
+    _User_extensions_Thread_terminate_visitor,
+    CHAIN_ITERATOR_FORWARD
+  );
+}
+
+static inline void _User_extensions_Acquire( ISR_lock_Context *lock_context )
+{
+  _ISR_lock_ISR_disable_and_acquire(
+    &_User_extensions_List.Lock,
+    lock_context
+  );
+}
+
+static inline void _User_extensions_Release( ISR_lock_Context *lock_context )
+{
+  _ISR_lock_Release_and_ISR_enable(
+    &_User_extensions_List.Lock,
+    lock_context
+  );
+}
+
+static inline void _User_extensions_Destroy_iterators(
+  Thread_Control *the_thread
+)
+{
+  ISR_lock_Context          lock_context;
+  User_extensions_Iterator *iter;
+
+  _User_extensions_Acquire( &lock_context );
+
+  iter = the_thread->last_user_extensions_iterator;
+
+  while ( iter != NULL ) {
+    _Chain_Iterator_destroy( &iter->Iterator );
+    iter = iter->previous;
+  }
+
+  _User_extensions_Release( &lock_context );
 }
 
Index: cpukit/score/src/threadrestart.c
===================================================================
--- cpukit/score/src/threadrestart.c	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ cpukit/score/src/threadrestart.c	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -98,4 +98,5 @@
 
   _User_extensions_Thread_delete( the_thread );
+  _User_extensions_Destroy_iterators( the_thread );
   _ISR_lock_Destroy( &the_thread->Keys.Lock );
   _Scheduler_Node_destroy( _Scheduler_Get( the_thread ), the_thread );
@@ -256,4 +257,5 @@
       executing->Life.state = THREAD_LIFE_NORMAL;
 
+      _User_extensions_Destroy_iterators( executing );
       _Thread_Load_environment( executing );
       _Thread_Restart_self( executing );
Index: cpukit/score/src/userextaddset.c
===================================================================
--- cpukit/score/src/userextaddset.c	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ cpukit/score/src/userextaddset.c	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -21,7 +21,5 @@
 
 #include <rtems/score/userextimpl.h>
-#include <rtems/score/objectimpl.h>
 #include <rtems/score/percpu.h>
-#include <rtems/score/sysstate.h>
 
 void _User_extensions_Add_set(
@@ -29,10 +27,12 @@
 )
 {
-  _Assert(
-    _Objects_Allocator_is_owner()
-      || _System_state_Is_before_multitasking( _System_state_Get() )
+  ISR_lock_Context lock_context;
+
+  _User_extensions_Acquire( &lock_context );
+  _Chain_Append_unprotected(
+    &_User_extensions_List.Active,
+    &the_extension->Node
   );
-
-  _Chain_Append_unprotected( &_User_extensions_List, &the_extension->Node );
+  _User_extensions_Release( &lock_context );
 
   /*
Index: cpukit/score/src/userextiterate.c
===================================================================
--- cpukit/score/src/userextiterate.c	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ cpukit/score/src/userextiterate.c	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -8,8 +8,8 @@
 
 /*
- * Copyright (c) 2012 embedded brains GmbH.  All rights reserved.
+ * Copyright (c) 2012, 2016 embedded brains GmbH.  All rights reserved.
  *
  *  embedded brains GmbH
- *  Obere Lagerstr. 30
+ *  Dornierstr. 4
  *  82178 Puchheim
  *  Germany
@@ -28,5 +28,14 @@
 #include <rtems/score/userextimpl.h>
 
-CHAIN_DEFINE_EMPTY( _User_extensions_List );
+#include <pthread.h>
+
+User_extensions_List _User_extensions_List = {
+  CHAIN_INITIALIZER_EMPTY( _User_extensions_List.Active ),
+  CHAIN_ITERATOR_REGISTRY_INITIALIZER( _User_extensions_List.Iterators )
+#if defined(RTEMS_SMP)
+  ,
+  ISR_LOCK_INITIALIZER( "User Extensions List" )
+#endif
+};
 
 void _User_extensions_Thread_create_visitor(
@@ -140,15 +149,22 @@
 
 void _User_extensions_Iterate(
-  void                    *arg,
-  User_extensions_Visitor  visitor
-)
-{
-  Thread_Control *executing = _Thread_Get_executing();
-  const User_extensions_Table *callouts_current =
-    rtems_configuration_get_user_extension_table();
-  const User_extensions_Table *callouts_end =
-    callouts_current + rtems_configuration_get_number_of_initial_extensions();
-  const Chain_Node *node;
-  const Chain_Node *tail;
+  void                     *arg,
+  User_extensions_Visitor   visitor,
+  Chain_Iterator_direction  direction
+)
+{
+  Thread_Control              *executing;
+  const User_extensions_Table *callouts_current;
+  const User_extensions_Table *callouts_end;
+  const Chain_Node            *end;
+  Chain_Node                  *node;
+  User_extensions_Iterator     iter;
+  ISR_lock_Context             lock_context;
+
+  executing = _Thread_Get_executing();
+
+  callouts_current = rtems_configuration_get_user_extension_table();
+  callouts_end = callouts_current
+    + rtems_configuration_get_number_of_initial_extensions();
 
   while ( callouts_current != callouts_end ) {
@@ -158,13 +174,43 @@
   }
 
-  node = _Chain_Immutable_first( &_User_extensions_List );
-  tail = _Chain_Immutable_tail( &_User_extensions_List );
-  while ( node != tail ) {
-    const User_extensions_Control *extension =
-      (const User_extensions_Control *) node;
-
-    (*visitor)( executing, arg, &extension->Callouts );
-
-    node = _Chain_Immutable_next( node );
-  }
-}
+  if ( direction == CHAIN_ITERATOR_FORWARD ) {
+    end = _Chain_Immutable_tail( &_User_extensions_List.Active );
+  } else {
+    end = _Chain_Immutable_head( &_User_extensions_List.Active );
+  }
+
+  _User_extensions_Acquire( &lock_context );
+
+  _Chain_Iterator_initialize(
+    &_User_extensions_List.Active,
+    &_User_extensions_List.Iterators,
+    &iter.Iterator,
+    direction
+  );
+
+  if ( executing != NULL ) {
+    iter.previous = executing->last_user_extensions_iterator;
+    executing->last_user_extensions_iterator = &iter;
+  }
+
+  while ( ( node = _Chain_Iterator_next( &iter.Iterator ) ) != end ) {
+    const User_extensions_Control *extension;
+
+    _Chain_Iterator_set_position( &iter.Iterator, node );
+
+    _User_extensions_Release( &lock_context );
+
+    extension = (const User_extensions_Control *) node;
+    ( *visitor )( executing, arg, &extension->Callouts );
+
+    _User_extensions_Acquire( &lock_context );
+  }
+
+  if ( executing != NULL ) {
+    executing->last_user_extensions_iterator = iter.previous;
+  }
+
+  _Chain_Iterator_destroy( &iter.Iterator );
+
+  _User_extensions_Release( &lock_context );
+}
Index: cpukit/score/src/userextremoveset.c
===================================================================
--- cpukit/score/src/userextremoveset.c	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ cpukit/score/src/userextremoveset.c	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -21,5 +21,4 @@
 
 #include <rtems/score/userextimpl.h>
-#include <rtems/score/objectimpl.h>
 #include <rtems/score/percpu.h>
 
@@ -28,7 +27,13 @@
 )
 {
-  _Assert( _Objects_Allocator_is_owner() );
+  ISR_lock_Context lock_context;
 
+  _User_extensions_Acquire( &lock_context );
+  _Chain_Iterator_registry_update(
+    &_User_extensions_List.Iterators,
+    &the_extension->Node
+  );
   _Chain_Extract_unprotected( &the_extension->Node );
+  _User_extensions_Release( &lock_context );
 
   /*
Index: testsuites/sptests/Makefile.am
===================================================================
--- testsuites/sptests/Makefile.am	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ testsuites/sptests/Makefile.am	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -34,4 +34,5 @@
     spsem_err02 sptask_err01 spevent_err03 sptask_err03 sptask_err02 \
     sptask_err04 spclock_err01
+_SUBDIRS += spextensions01
 _SUBDIRS += spsysinit01
 if HAS_SMP
Index: testsuites/sptests/configure.ac
===================================================================
--- testsuites/sptests/configure.ac	(revision 0a97ba5bc118bce28b718dc12069f02087d52692)
+++ testsuites/sptests/configure.ac	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -47,4 +47,5 @@
 # Explicitly list all Makefiles here
 AC_CONFIG_FILES([Makefile
+spextensions01/Makefile
 sptimerserver01/Makefile
 spsysinit01/Makefile
Index: testsuites/sptests/spextensions01/Makefile.am
===================================================================
--- testsuites/sptests/spextensions01/Makefile.am	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
+++ testsuites/sptests/spextensions01/Makefile.am	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -0,0 +1,19 @@
+rtems_tests_PROGRAMS = spextensions01
+spextensions01_SOURCES = init.c
+
+dist_rtems_tests_DATA = spextensions01.scn spextensions01.doc
+
+include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg
+include $(top_srcdir)/../automake/compile.am
+include $(top_srcdir)/../automake/leaf.am
+
+AM_CPPFLAGS += -I$(top_srcdir)/../support/include
+
+LINK_OBJS = $(spextensions01_OBJECTS)
+LINK_LIBS = $(spextensions01_LDLIBS)
+
+spextensions01$(EXEEXT): $(spextensions01_OBJECTS) $(spextensions01_DEPENDENCIES)
+	@rm -f spextensions01$(EXEEXT)
+	$(make-exe)
+
+include $(top_srcdir)/../automake/local.am
Index: testsuites/sptests/spextensions01/init.c
===================================================================
--- testsuites/sptests/spextensions01/init.c	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
+++ testsuites/sptests/spextensions01/init.c	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -0,0 +1,447 @@
+/*
+ * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
+ *
+ *  embedded brains GmbH
+ *  Dornierstr. 4
+ *  82178 Puchheim
+ *  Germany
+ *  <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
+ */
+
+#ifdef HAVE_CONFIG_H
+  #include "config.h"
+#endif
+
+#include <assert.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include <rtems/test.h>
+
+#include <bsp.h>
+
+const char rtems_test_name[] = "SPEXTENSIONS 1";
+
+static int counter;
+
+static int active_extensions = 2;
+
+static rtems_id master_task;
+
+static void assert_static_order(int index)
+{
+  assert((counter % active_extensions) == index);
+  ++counter;
+}
+
+static void assert_forward_order(int index)
+{
+  assert((counter % active_extensions) == index);
+  ++counter;
+}
+
+static void assert_reverse_order(int index)
+{
+  assert((counter % active_extensions) == (5 - index));
+  ++counter;
+}
+
+static bool zero_thread_create(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(0);
+  return true;
+}
+
+static void zero_thread_start(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(0);
+}
+
+static void zero_thread_restart(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(0);
+}
+
+static void zero_thread_delete(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(0);
+}
+
+static void zero_thread_switch(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(0);
+}
+
+static void zero_thread_begin(rtems_tcb *a)
+{
+  assert_static_order(0);
+}
+
+static void zero_thread_exitted(rtems_tcb *a)
+{
+  assert_static_order(0);
+}
+
+static void zero_fatal(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code code
+)
+{
+  if (source == RTEMS_FATAL_SOURCE_EXIT) {
+    assert_static_order(0);
+  }
+}
+
+static void zero_thread_terminate(rtems_tcb *a)
+{
+  assert_static_order(0);
+}
+
+static bool one_thread_create(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(1);
+  return true;
+}
+
+static void one_thread_start(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(1);
+}
+
+static void one_thread_restart(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(1);
+}
+
+static void one_thread_delete(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(1);
+}
+
+static void one_thread_switch(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(1);
+}
+
+static void one_thread_begin(rtems_tcb *a)
+{
+  assert_static_order(1);
+}
+
+static void one_thread_exitted(rtems_tcb *a)
+{
+  assert_static_order(1);
+}
+
+static void one_fatal(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code code
+)
+{
+  if (source == RTEMS_FATAL_SOURCE_EXIT) {
+    assert_static_order(1);
+  }
+}
+
+static void one_thread_terminate(rtems_tcb *a)
+{
+  assert_static_order(1);
+}
+
+static bool two_thread_create(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_forward_order(2);
+  return true;
+}
+
+static void two_thread_start(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_forward_order(2);
+}
+
+static void two_thread_restart(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(2);
+}
+
+static void two_thread_delete(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_reverse_order(2);
+}
+
+static void two_thread_switch(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_forward_order(2);
+}
+
+static void two_thread_begin(rtems_tcb *a)
+{
+  assert_forward_order(2);
+}
+
+static void two_thread_exitted(rtems_tcb *a)
+{
+  assert_forward_order(2);
+}
+
+static void two_fatal(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code code
+)
+{
+  if (source == RTEMS_FATAL_SOURCE_EXIT) {
+    assert_reverse_order(2);
+    assert(counter == 72);
+    rtems_test_endk();
+  }
+}
+
+static void two_thread_terminate(rtems_tcb *a)
+{
+  assert_forward_order(2);
+}
+
+static bool three_thread_create(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_forward_order(3);
+  return true;
+}
+
+static void three_thread_start(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_forward_order(3);
+}
+
+static void three_thread_restart(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_static_order(3);
+}
+
+static void three_thread_delete(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_reverse_order(3);
+}
+
+static void three_thread_switch(rtems_tcb *a, rtems_tcb *b)
+{
+  assert_forward_order(3);
+}
+
+static void three_thread_begin(rtems_tcb *a)
+{
+  assert_forward_order(3);
+}
+
+static void three_thread_exitted(rtems_tcb *a)
+{
+  assert_forward_order(3);
+}
+
+static void three_fatal(
+  rtems_fatal_source source,
+  bool is_internal,
+  rtems_fatal_code code
+)
+{
+  if (source == RTEMS_FATAL_SOURCE_EXIT) {
+    assert_reverse_order(3);
+  }
+}
+
+static void three_thread_terminate(rtems_tcb *a)
+{
+  assert_forward_order(3);
+}
+
+#define ZERO \
+  { \
+    .thread_create = zero_thread_create, \
+    .thread_start = zero_thread_start, \
+    .thread_restart = zero_thread_restart, \
+    .thread_delete = zero_thread_delete, \
+    .thread_switch = zero_thread_switch, \
+    .thread_begin = zero_thread_begin, \
+    .thread_exitted = zero_thread_exitted, \
+    .fatal = zero_fatal, \
+    .thread_terminate = zero_thread_terminate \
+  }
+
+#define ONE \
+  { \
+    .thread_create = one_thread_create, \
+    .thread_start = one_thread_start, \
+    .thread_restart = one_thread_restart, \
+    .thread_delete = one_thread_delete, \
+    .thread_switch = one_thread_switch, \
+    .thread_begin = one_thread_begin, \
+    .thread_exitted = one_thread_exitted, \
+    .fatal = one_fatal, \
+    .thread_terminate = one_thread_terminate \
+  }
+
+static const rtems_extensions_table two = {
+  .thread_create = two_thread_create,
+  .thread_start = two_thread_start,
+  .thread_restart = two_thread_restart,
+  .thread_delete = two_thread_delete,
+  .thread_switch = two_thread_switch,
+  .thread_begin = two_thread_begin,
+  .thread_exitted = two_thread_exitted,
+  .fatal = two_fatal,
+  .thread_terminate = two_thread_terminate
+};
+
+static const rtems_extensions_table three = {
+  .thread_create = three_thread_create,
+  .thread_start = three_thread_start,
+  .thread_restart = three_thread_restart,
+  .thread_delete = three_thread_delete,
+  .thread_switch = three_thread_switch,
+  .thread_begin = three_thread_begin,
+  .thread_exitted = three_thread_exitted,
+  .fatal = three_fatal,
+  .thread_terminate = three_thread_terminate
+};
+
+static const rtems_extensions_table initial_test =
+  RTEMS_TEST_INITIAL_EXTENSION;
+
+#ifdef BSP_INITIAL_EXTENSION
+static const rtems_extensions_table initial_bsp =
+  BSP_INITIAL_EXTENSION;
+#endif
+
+static void wake_up_master(void)
+{
+  rtems_status_code sc;
+
+  sc = rtems_event_transient_send(master_task);
+  assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void wait_for_worker(void)
+{
+  rtems_status_code sc;
+
+  sc = rtems_event_transient_receive(
+    RTEMS_WAIT,
+    RTEMS_NO_TIMEOUT
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+}
+
+static void worker(rtems_task_argument arg)
+{
+  wake_up_master();
+
+  (void) rtems_task_suspend(RTEMS_SELF);
+  assert(false);
+}
+
+static void test(void)
+{
+  rtems_status_code sc;
+  rtems_id id;
+
+  master_task = rtems_task_self();
+
+#ifdef BSP_INITIAL_EXTENSION
+  sc = rtems_extension_create(
+    rtems_build_name(' ', 'B', 'S', 'P'),
+    &initial_bsp,
+    &id
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+#undef BSP_INITIAL_EXTENSION
+#endif
+
+  sc = rtems_extension_create(
+    rtems_build_name('T', 'E', 'S', 'T'),
+    &initial_test,
+    &id
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  sc = rtems_extension_create(
+    rtems_build_name('2', ' ', ' ', ' '),
+    &two,
+    &id
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  sc = rtems_extension_create(
+    rtems_build_name('3', ' ', ' ', ' '),
+    &three,
+    &id
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  active_extensions = 4;
+  assert(counter == 14);
+  counter = 16;
+
+  sc = rtems_task_create(
+    rtems_build_name('W', 'O', 'R', 'K'),
+    2,
+    RTEMS_MINIMUM_STACK_SIZE,
+    RTEMS_DEFAULT_MODES,
+    RTEMS_DEFAULT_ATTRIBUTES,
+    &id
+  );
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  sc = rtems_task_start(id, worker, 0);
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  wait_for_worker();
+
+  sc = rtems_task_restart(id, 0);
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  wait_for_worker();
+
+  sc = rtems_task_delete(id);
+  assert(sc == RTEMS_SUCCESSFUL);
+
+  /* Process zombies to trigger delete extensions */
+  sc = rtems_task_create(
+    rtems_build_name('N', 'U', 'L', 'L'),
+    2,
+    SIZE_MAX,
+    RTEMS_DEFAULT_MODES,
+    RTEMS_DEFAULT_ATTRIBUTES,
+    &id
+  );
+  assert(sc == RTEMS_UNSATISFIED);
+}
+
+static void Init(rtems_task_argument arg)
+{
+  rtems_test_begink();
+
+  test();
+
+  exit(0);
+}
+
+#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
+#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
+
+#define CONFIGURE_MAXIMUM_USER_EXTENSIONS 4
+
+#define CONFIGURE_MAXIMUM_TASKS 2
+
+#define CONFIGURE_INITIAL_EXTENSIONS ZERO, ONE
+
+#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
+
+#define CONFIGURE_INIT
+
+#include <rtems/confdefs.h>
Index: testsuites/sptests/spextensions01/spextensions01.scn
===================================================================
--- testsuites/sptests/spextensions01/spextensions01.scn	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
+++ testsuites/sptests/spextensions01/spextensions01.scn	(revision 709f38a97287ff1aa8e8c0668c2d066e711db87c)
@@ -0,0 +1,2 @@
+*** BEGIN OF TEST SPEXTENSIONS 1 ***
+*** END OF TEST SPEXTENSIONS 1 ***
