Changeset 5468464 in rtems


Ignore:
Timestamp:
Nov 11, 2021, 7:44:29 AM (2 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
675e879
Parents:
3b6e263a
git-author:
Sebastian Huber <sebastian.huber@…> (11/11/21 07:44:29)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/23/21 10:00:28)
Message:

score: Properly continue the thread during restart

The _Thread_queue_Extract() does not deal with potential priority
updates and the SMP locking protocol handling. Use
_Thread_queue_Continue(). For the POSIX signals processing this is
currently probably unnecessary, however, the use case is similar to the
restart so use the same appoach.

Close #4546.

Location:
cpukit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/status.h

    r3b6e263a r5468464  
    107107  STATUS_INTERRUPTED =
    108108    STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, EINTR ),
     109  STATUS_INTERNAL_ERROR =
     110    STATUS_BUILD( STATUS_CLASSIC_INTERNAL_ERROR, ENOTSUP ),
    109111  STATUS_INVALID_ADDRESS =
    110112    STATUS_BUILD( STATUS_CLASSIC_INVALID_ADDRESS, EFAULT ),
  • cpukit/include/rtems/score/threadimpl.h

    r3b6e263a r5468464  
    26992699 *
    27002700 * @param[in, out] the_thread is the thread.
     2701 *
     2702 * @param status is the thread wait status.
    27012703 */
    27022704RTEMS_INLINE_ROUTINE void _Thread_Timer_remove_and_continue(
    2703   Thread_Control *the_thread
     2705  Thread_Control *the_thread,
     2706  Status_Control  status
    27042707)
    27052708{
     
    27082711  _Thread_MP_Extract_proxy( the_thread );
    27092712#endif
    2710   _Thread_queue_Extract( the_thread );
     2713  _Thread_Continue( the_thread, status );
    27112714}
    27122715
  • cpukit/posix/src/psignalunblockthread.c

    r3b6e263a r5468464  
    176176}
    177177
    178 static void _POSIX_signals_Interrupt_thread( Thread_Control *the_thread )
    179 {
    180 #if defined(RTEMS_MULTIPROCESSING)
    181   _Thread_MP_Extract_proxy( the_thread );
    182 #endif
    183   the_thread->Wait.return_code = STATUS_INTERRUPTED;
    184   _Thread_queue_Extract( the_thread );
    185 }
    186 
    187178bool _POSIX_signals_Unblock_thread(
    188179  Thread_Control  *the_thread,
     
    216207      }
    217208
    218       _POSIX_signals_Interrupt_thread( the_thread );
     209      _Thread_Timer_remove_and_continue( the_thread, STATUS_INTERRUPTED );
    219210      return _POSIX_signals_Unblock_thread_done( the_thread, api, true );
    220211    }
     
    246237
    247238    if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) {
    248       _POSIX_signals_Interrupt_thread( the_thread );
     239      _Thread_Timer_remove_and_continue( the_thread, STATUS_INTERRUPTED );
    249240    }
    250241  }
  • cpukit/score/src/threadrestart.c

    r3b6e263a r5468464  
    138138
    139139  _Thread_Set_state( the_thread, STATES_ZOMBIE );
    140   _Thread_Timer_remove_and_continue( the_thread );
     140  _Thread_Timer_remove_and_continue( the_thread, STATUS_INTERNAL_ERROR );
    141141
    142142  /*
     
    358358     * SMP configurations.  We could interrupt an extract operation on another
    359359     * processor disregarding the thread wait flags.  Rely on
    360      * _Thread_queue_Extract() for removal of these states.
     360     * _Thread_Continue() for removal of these states.
    361361     */
    362362    _Thread_Clear_state_locked(
     
    409409    _Thread_State_release( the_thread, lock_context );
    410410
    411     _Thread_Timer_remove_and_continue( the_thread );
     411    _Thread_Timer_remove_and_continue( the_thread, STATUS_INTERNAL_ERROR );
    412412    _Thread_Remove_life_change_request( the_thread );
    413413  } else {
Note: See TracChangeset for help on using the changeset viewer.