Changeset 57be57c7 in rtems


Ignore:
Timestamp:
May 14, 2021, 7:31:47 AM (5 weeks ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b9083c55
Parents:
b87d2a6
git-author:
Sebastian Huber <sebastian.huber@…> (05/14/21 07:31:47)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/14/21 07:37:19)
Message:

score: Return status in _Thread_Restart_other()

This simplifies rtems_task_restart().

Location:
cpukit
Files:
3 edited

Legend:

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

    rb87d2a6 r57be57c7  
    287287 * @brief Restarts the thread.
    288288 *
    289  * @param[in, out] the_thread The thread to restart.
    290  * @param entry The start entry information for @a the_thread.
    291  * @param lock_context The lock context.
    292  *
    293  * @retval true The operation was successful.
    294  * @retval false The operation failed.
    295  */
    296 bool _Thread_Restart_other(
     289 * @param[in, out] the_thread is the thread to restart.
     290 *
     291 * @param entry is the new start entry information for the thread to restart.
     292 *
     293 * @param[in, out] lock_context is the lock context with interrupts disabled.
     294 *
     295 * @retval STATUS_SUCCESSFUL The operation was successful.
     296 *
     297 * @retval STATUS_INCORRECT_STATE The thread was dormant.
     298 */
     299Status_Control _Thread_Restart_other(
    297300  Thread_Control                 *the_thread,
    298301  const Thread_Entry_information *entry,
  • cpukit/rtems/src/taskrestart.c

    rb87d2a6 r57be57c7  
    2222
    2323#include <rtems/rtems/tasks.h>
     24#include <rtems/rtems/statusimpl.h>
    2425#include <rtems/score/threadimpl.h>
    2526
     
    3233  ISR_lock_Context          lock_context;
    3334  Thread_Entry_information  entry;
    34   bool                      ok;
     35  Status_Control            status;
    3536
    3637  the_thread = _Thread_Get( id, &lock_context );
     
    5455  }
    5556
    56   ok = _Thread_Restart_other( the_thread, &entry, &lock_context );
     57  status = _Thread_Restart_other( the_thread, &entry, &lock_context );
    5758
    58   return ok ? RTEMS_SUCCESSFUL : RTEMS_INCORRECT_STATE;
     59  return _Status_Get( status );
    5960}
  • cpukit/score/src/threadrestart.c

    rb87d2a6 r57be57c7  
    525525}
    526526
    527 bool _Thread_Restart_other(
     527Status_Control _Thread_Restart_other(
    528528  Thread_Control                 *the_thread,
    529529  const Thread_Entry_information *entry,
     
    538538  if ( _States_Is_dormant( the_thread->current_state ) ) {
    539539    _Thread_State_release( the_thread, lock_context );
    540     return false;
     540    return STATUS_INCORRECT_STATE;
    541541  }
    542542
     
    565565
    566566  _Thread_Dispatch_enable( cpu_self );
    567   return true;
     567  return STATUS_SUCCESSFUL;
    568568}
    569569
Note: See TracChangeset for help on using the changeset viewer.