Changeset df55d07f in rtems


Ignore:
Timestamp:
Dec 10, 2015, 1:10:48 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
32c2cd2
Parents:
d0c39838
git-author:
Sebastian Huber <sebastian.huber@…> (12/10/15 13:10:48)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/11/15 07:20:48)
Message:

score: Untangle thread actions

Remove the thread action handler parameter from
_Thread_Action_initialize() and instead set it later in
_Thread_Add_post_switch_action(). This avoids a dependency on the
thread action handler via the thread initialization.

Location:
cpukit
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/psignalunblockthread.c

    rd0c39838 rdf55d07f  
    4141)
    4242{
    43   _Thread_Add_post_switch_action( the_thread, &api->Signal_action );
     43  _Thread_Add_post_switch_action(
     44    the_thread,
     45    &api->Signal_action,
     46    _POSIX_signals_Action_handler
     47  );
    4448
    4549  return status;
  • cpukit/posix/src/pthread.c

    rd0c39838 rdf55d07f  
    230230  }
    231231
    232   _Thread_Action_initialize(
    233     &api->Signal_action,
    234     _POSIX_signals_Action_handler
    235   );
    236 
     232  _Thread_Action_initialize( &api->Signal_action );
    237233  _Thread_queue_Initialize( &api->Join_List, THREAD_QUEUE_DISCIPLINE_FIFO );
    238234
  • cpukit/rtems/src/signalsend.c

    rd0c39838 rdf55d07f  
    5050          _Thread_Add_post_switch_action(
    5151            the_thread,
    52             &api->Signal_action
     52            &api->Signal_action,
     53            _Signal_Action_handler
    5354          );
    5455        } else {
  • cpukit/rtems/src/taskmode.c

    rd0c39838 rdf55d07f  
    2222#include <rtems/rtems/asrimpl.h>
    2323#include <rtems/rtems/modesimpl.h>
     24#include <rtems/rtems/signalimpl.h>
    2425#include <rtems/score/schedulerimpl.h>
    2526#include <rtems/score/threadimpl.h>
     
    104105        _Thread_Add_post_switch_action(
    105106          executing,
    106           &api->Signal_action
     107          &api->Signal_action,
     108          _Signal_Action_handler
    107109        );
    108110      }
  • cpukit/rtems/src/tasks.c

    rd0c39838 rdf55d07f  
    5656
    5757  _ASR_Create( &api->Signal );
    58   _Thread_Action_initialize( &api->Signal_action, _Signal_Action_handler );
     58  _Thread_Action_initialize( &api->Signal_action );
    5959#if !defined(RTEMS_SMP)
    6060  created->task_variables = NULL;
  • cpukit/score/include/rtems/score/threadimpl.h

    rd0c39838 rdf55d07f  
    848848
    849849RTEMS_INLINE_ROUTINE void _Thread_Action_initialize(
    850   Thread_Action         *action,
    851   Thread_Action_handler  handler
    852 )
    853 {
    854   action->handler = handler;
     850  Thread_Action *action
     851)
     852{
    855853  _Chain_Set_off_chain( &action->Node );
    856854}
     
    891889
    892890RTEMS_INLINE_ROUTINE void _Thread_Add_post_switch_action(
    893   Thread_Control *thread,
    894   Thread_Action  *action
     891  Thread_Control        *thread,
     892  Thread_Action         *action,
     893  Thread_Action_handler  handler
    895894)
    896895{
     
    899898
    900899  cpu_of_thread = _Thread_Action_ISR_disable_and_acquire( thread, &level );
     900
     901  action->handler = handler;
    901902
    902903#if defined(RTEMS_SMP)
  • cpukit/score/src/threadinitialize.c

    rd0c39838 rdf55d07f  
    244244  _Thread_Action_control_initialize( &the_thread->Post_switch_actions );
    245245
    246   _Thread_Action_initialize(
    247     &the_thread->Life.Action,
    248     _Thread_Life_action_handler
    249   );
     246  _Thread_Action_initialize( &the_thread->Life.Action );
    250247  the_thread->Life.state = THREAD_LIFE_NORMAL;
    251248  the_thread->Life.terminator = NULL;
  • cpukit/score/src/threadrestart.c

    rd0c39838 rdf55d07f  
    177177}
    178178
     179static void _Thread_Add_life_change_action(
     180  Thread_Control *the_thread
     181)
     182{
     183  _Thread_Add_post_switch_action(
     184    the_thread,
     185    &the_thread->Life.Action,
     186    _Thread_Life_action_handler
     187  );
     188}
     189
    179190static void _Thread_Start_life_change_for_executing(
    180191  Thread_Control *executing
     
    187198  );
    188199
    189   _Thread_Add_post_switch_action( executing, &executing->Life.Action );
     200  _Thread_Add_life_change_action( executing );
    190201}
    191202
     
    272283    false
    273284  );
    274   _Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action );
     285  _Thread_Add_life_change_action( the_thread );
    275286  _Thread_Ready( the_thread );
    276287}
Note: See TracChangeset for help on using the changeset viewer.