Changeset 518d82b in rtems


Ignore:
Timestamp:
Aug 20, 2013, 9:01:55 AM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
2cfbf23a
Parents:
0432dff7
git-author:
Sebastian Huber <sebastian.huber@…> (08/20/13 09:01:55)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/20/13 09:03:38)
Message:

smp: Disable restart of threads other than self

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/score/src/threadrestart.c

    r0432dff7 r518d82b  
    2121#include <rtems/score/threadimpl.h>
    2222#include <rtems/score/userextimpl.h>
     23#include <rtems/config.h>
    2324
    2425bool _Thread_Restart(
     
    2829)
    2930{
     31#if defined( RTEMS_SMP )
     32  if (
     33    rtems_configuration_is_smp_enabled()
     34      && !_Thread_Is_executing( the_thread )
     35  ) {
     36    return false;
     37  }
     38#endif
     39
    3040  if ( !_States_Is_dormant( the_thread->current_state ) ) {
    3141
  • testsuites/smptests/smpunsupported01/init.c

    r0432dff7 r518d82b  
    1818
    1919#include "tmacros.h"
     20
     21static void some_task(rtems_task_argument arg)
     22{
     23  (void) arg;
     24
     25  while (1);
     26}
    2027
    2128static void test(void)
     
    5158  );
    5259  rtems_test_assert(sc == RTEMS_UNSATISFIED);
     60
     61  sc = rtems_task_create(
     62    rtems_build_name('T', 'A', 'S', 'K'),
     63    RTEMS_MAXIMUM_PRIORITY,
     64    RTEMS_MINIMUM_STACK_SIZE,
     65    RTEMS_DEFAULT_MODES,
     66    RTEMS_DEFAULT_ATTRIBUTES,
     67    &id
     68  );
     69  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     70
     71  sc = rtems_task_start(id, some_task, 0);
     72  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     73
     74  sc = rtems_task_restart(id, 0);
     75  rtems_test_assert(sc == RTEMS_INCORRECT_STATE);
    5376}
    5477
Note: See TracChangeset for help on using the changeset viewer.