Changeset 718b2b6 in rtems-schedsim


Ignore:
Timestamp:
May 23, 2014, 9:26:28 PM (5 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
44cf36b
Parents:
fef4882
git-author:
Joel Sherrill <joel.sherrill@…> (05/23/14 21:26:28)
git-committer:
Joel Sherrill <joel.sherrill@…> (05/23/14 21:46:49)
Message:

main_semobtain.c: Locked access to executing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • schedsim/shell/shared/main_semobtain.c

    rfef4882 r718b2b6  
    2121#include <schedsim_shell.h>
    2222#include <rtems/error.h>
     23
     24static Thread_Control *get_thread_executing(void)
     25{
     26  Thread_Control *e;
     27
     28  _Thread_Disable_dispatch();
     29    e = _Thread_Executing;
     30  _Thread_Enable_dispatch();
     31  return e;
     32}
    2333
    2434int rtems_shell_main_semaphore_obtain(
     
    5969   *  just return successfully.
    6070   */
    61   caller = _Thread_Executing;
     71  caller = get_thread_executing();
    6272  printf("Obtain semaphore (0x%08x) with timeout %d\n", id, ticks );
    6373  status = rtems_semaphore_obtain( id, RTEMS_DEFAULT_OPTIONS, ticks );
    64   if ( caller == _Thread_Executing ) {
     74  if ( caller == get_thread_executing() ) {
    6575    if ( status != RTEMS_SUCCESSFUL ) {
    6676      fprintf(
Note: See TracChangeset for help on using the changeset viewer.