Ignore:
Timestamp:
May 21, 2014, 8:30:34 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
1bf0666
Parents:
c8e83288
git-author:
Sebastian Huber <sebastian.huber@…> (05/21/14 08:30:34)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/21/14 09:48:25)
Message:

score: _Thread_Set_life_protection()

Enable usage of _Thread_Set_life_protection() in thread dispatch
critical sections. This can be used to enable the thread
life-protection with thread dispatching disabled and then enable thread
dispatching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smpthreadlife01/init.c

    rc8e83288 r82f90743  
    183183}
    184184
    185 static void delay_ipi_task(rtems_task_argument arg)
     185static void delay_ipi_task(rtems_task_argument variant)
    186186{
    187187  test_context *ctx = &test_instance;
     
    199199  rtems_counter_delay_nanoseconds(100000000);
    200200
    201   /* We get deleted as a side effect of enabling the thread life protection */
     201  if (variant != 0) {
     202    _Thread_Disable_dispatch();
     203  }
     204
     205  /*
     206   * We get deleted as a side effect of enabling the thread life protection or
     207   * later if we enable the thread dispatching.
     208   */
    202209  _Thread_Set_life_protection(true);
     210
     211  if (variant != 0) {
     212    _Thread_Enable_dispatch();
     213  }
     214
    203215  rtems_test_assert(0);
    204216}
    205217
    206 static void test_set_life_protection(void)
     218static void test_set_life_protection(rtems_task_argument variant)
    207219{
    208220  test_context *ctx = &test_instance;
     
    223235  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    224236
    225   sc = rtems_task_start(id, delay_ipi_task, 0);
     237  sc = rtems_task_start(id, delay_ipi_task, variant);
    226238  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    227239
     
    302314    test_restart();
    303315    test_delete();
    304     test_set_life_protection();
     316    test_set_life_protection(0);
     317    test_set_life_protection(1);
    305318    test_wait_for_execution_stop();
    306319  }
Note: See TracChangeset for help on using the changeset viewer.