rtems: Error for task delete on SMP

Task deletion is currently not implemented on SMP configurations.
This commit is contained in:
Sebastian Huber
2013-07-18 11:34:29 +02:00
parent f913c796ff
commit 50ccf988c2
3 changed files with 14 additions and 5 deletions

View File

@@ -19,6 +19,7 @@
#endif
#include <rtems/system.h>
#include <rtems/config.h>
#include <rtems/rtems/status.h>
#include <rtems/rtems/support.h>
#include <rtems/rtems/modes.h>
@@ -38,13 +39,16 @@ rtems_status_code rtems_task_delete(
rtems_id id
)
{
#ifdef RTEMS_SMP
return rtems_task_suspend( id );
#else /* RTEMS_SMP */
register Thread_Control *the_thread;
Objects_Locations location;
Objects_Information *the_information;
#if defined( RTEMS_SMP )
if ( rtems_configuration_is_smp_enabled() ) {
return RTEMS_NOT_IMPLEMENTED;
}
#endif
_RTEMS_Lock_allocator();
the_thread = _Thread_Get( id, &location );
@@ -94,5 +98,4 @@ rtems_status_code rtems_task_delete(
_RTEMS_Unlock_allocator();
return RTEMS_INVALID_ID;
#endif /* RTEMS_SMP */
}

View File

@@ -90,5 +90,6 @@ rtems_task Init(
directive_failed( status, "task start" );
}
status = rtems_task_delete( RTEMS_SELF );
/* FIXME: Task deletion currently not supported */
(void) rtems_task_suspend( RTEMS_SELF );
}

View File

@@ -20,7 +20,12 @@
static void test(void)
{
rtems_status_code sc;
rtems_test_assert(rtems_configuration_is_smp_enabled());
sc = rtems_task_delete(RTEMS_SELF);
rtems_test_assert(sc == RTEMS_NOT_IMPLEMENTED);
}
static void Init(rtems_task_argument arg)