forked from Imagelibrary/rtems
rtems: Error for task delete on SMP
Task deletion is currently not implemented on SMP configurations.
This commit is contained in:
@@ -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 */
|
||||
}
|
||||
|
||||
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user