Changeset 17f1ffb in rtems


Ignore:
Timestamp:
Oct 13, 2003, 9:37:54 PM (17 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
62f0829
Parents:
67113c7
Message:

2003-10-13 Joel Sherrill <joel@…>

  • src/cleanuppop.c, src/cleanuppush.c: Protect use of _Workspace_Allocate and _Workspec_Free.
Location:
cpukit/posix
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/ChangeLog

    r67113c7 r17f1ffb  
     12003-10-13      Joel Sherrill <joel@OARcorp.com>
     2
     3        * src/cleanuppop.c, src/cleanuppush.c: Protect use of
     4        _Workspace_Allocate and _Workspec_Free.
     5
    162003-09-04      Joel Sherrill <joel@OARcorp.com>
    27
  • cpukit/posix/src/cleanuppop.c

    r67113c7 r17f1ffb  
    2929{
    3030  POSIX_Cancel_Handler_control      *handler;
     31  POSIX_Cancel_Handler_control      tmp_handler;
    3132  Chain_Control                     *handler_stack;
    3233  POSIX_API_Control                 *thread_support;
     
    3738  handler_stack = &thread_support->Cancellation_Handlers;
    3839
    39   if ( _Chain_Is_empty( handler_stack ) )
    40     return;
     40  _ISR_Disable( level );
     41    if ( _Chain_Is_empty( handler_stack ) ) {
     42      _ISR_Enable( level );
     43      return;
     44    }
    4145 
    42   _ISR_Disable( level );
    4346    handler = (POSIX_Cancel_Handler_control *)
    4447        _Chain_Tail( handler_stack )->previous;
    4548    _Chain_Extract_unprotected( &handler->Node );
     49   
    4650  _ISR_Enable( level );
    4751
     52  tmp_handler = *handler;
     53
     54  _Thread_Disable_dispatch();
     55    _Workspace_Free( handler );
     56  _Thread_Enable_dispatch();
     57
    4858  if ( execute )
    49     (*handler->routine)( handler->arg );
    50  
    51   _Workspace_Free( handler );
     59    (*tmp_handler.routine)( tmp_handler.arg );
    5260}
  • cpukit/posix/src/cleanuppush.c

    r67113c7 r17f1ffb  
    3636    return;          /* XXX what to do really? */
    3737
     38  _Thread_Disable_dispatch();
    3839  handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) );
    3940
    40   if ( !handler )
     41  if ( !handler ) {
     42    _Thread_Enable_dispatch();
    4143    return;          /* XXX what to do really? */
     44  }
    4245
    4346  thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ];
     
    4952
    5053  _Chain_Append( handler_stack, &handler->Node );
     54
     55  _Thread_Enable_dispatch();
    5156}
Note: See TracChangeset for help on using the changeset viewer.