Changeset 58a5889 in rtems


Ignore:
Timestamp:
Aug 26, 2013, 12:58:07 PM (6 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
4957272
Parents:
23de794d
git-author:
Sebastian Huber <sebastian.huber@…> (08/26/13 12:58:07)
git-committer:
Sebastian Huber <sebastian.huber@…> (08/27/13 08:48:16)
Message:

posix: Protect access to _POSIX_signals_Vectors

Assume the sigaction() is called only from thread context. Protect
against concurrent sigaction() invocations by different threads.

File:
1 edited

Legend:

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

    r23de794d r58a5889  
    4545  ISR_Level     level;
    4646
    47   if ( oact )
    48     *oact = _POSIX_signals_Vectors[ sig ];
    49 
    5047  if ( !sig )
    5148    rtems_set_errno_and_return_minus_one( EINVAL );
     
    6360  if ( sig == SIGKILL )
    6461    rtems_set_errno_and_return_minus_one( EINVAL );
     62
     63  _Thread_Disable_dispatch();
     64
     65  if ( oact )
     66    *oact = _POSIX_signals_Vectors[ sig ];
    6567
    6668  /*
     
    8688  }
    8789
    88   /*
    89    *  No need to evaluate or dispatch because:
    90    *
    91    *    + If we were ignoring the signal before, none could be pending
    92    *      now (signals not posted when SIG_IGN).
    93    *    + If we are now ignoring a signal that was previously pending,
    94    *      we clear the pending signal indicator.
    95    */
     90  _Thread_Enable_dispatch();
    9691
    9792  return 0;
Note: See TracChangeset for help on using the changeset viewer.