Changeset 44ed384 in rtems


Ignore:
Timestamp:
Apr 5, 2016, 2:23:39 PM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
9555341
Parents:
01226ec
git-author:
Sebastian Huber <sebastian.huber@…> (04/05/16 14:23:39)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/08/16 06:25:28)
Message:

posix: Use proper lock for sigaction()

Update #2555.

File:
1 edited

Legend:

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

    r01226ec r44ed384  
    2525#include <errno.h>
    2626
    27 #include <rtems/system.h>
    28 #include <rtems/posix/pthreadimpl.h>
    2927#include <rtems/posix/psignalimpl.h>
    3028#include <rtems/seterr.h>
    31 #include <rtems/score/isr.h>
    32 
    33 /*
    34  * PARAMETERS_PASSING_S is defined in ptimer.c
    35  */
    36 
    37 extern void PARAMETERS_PASSING_S (int num_signal, const struct sigaction inf);
    3829
    3930int sigaction(
     
    4334)
    4435{
    45   ISR_Level     level;
     36  ISR_lock_Context lock_context;
    4637
    4738  if ( !sig )
     
    6152    rtems_set_errno_and_return_minus_one( EINVAL );
    6253
    63   _Thread_Disable_dispatch();
     54  _POSIX_signals_Acquire( &lock_context );
    6455
    6556  if ( oact )
     
    7869     */
    7970
    80     _ISR_Disable( level );
    81       if ( act->sa_handler == SIG_DFL ) {
    82         _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
    83       } else {
    84          _POSIX_signals_Clear_process_signals( sig );
    85          _POSIX_signals_Vectors[ sig ] = *act;
    86       }
    87     _ISR_Enable( level );
     71    if ( act->sa_handler == SIG_DFL ) {
     72      _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ];
     73    } else {
     74       _POSIX_signals_Clear_process_signals( sig );
     75       _POSIX_signals_Vectors[ sig ] = *act;
     76    }
    8877  }
    8978
    90   _Thread_Enable_dispatch();
     79  _POSIX_signals_Release( &lock_context );
    9180
    9281  return 0;
Note: See TracChangeset for help on using the changeset viewer.