Changeset b04ee63 in rtems


Ignore:
Timestamp:
03/01/02 17:49:57 (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
9f9871f
Parents:
49155d9
Message:

2002-03-01 Eric Norum <eric.norum@…>

  • src/pthreadonce.c: Task is not preemptable while running a pthread_once init function. This is slightly less heavy handed than disabling dispatching and seems better than consuming a mutex.
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/ChangeLog

    r49155d9 rb04ee63  
     12002-03-01      Eric Norum <eric.norum@usask.ca>
     2
     3        * src/pthreadonce.c: Task is not preemptable while running a
     4        pthread_once init function.  This is slightly less heavy handed
     5        than disabling dispatching and seems better than consuming a mutex.
     6
    172002-02-09      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • c/src/exec/posix/src/pthreadonce.c

    r49155d9 rb04ee63  
    1919#include <errno.h>
    2020
     21#include <rtems.h>
    2122#include <rtems/system.h>
    2223#include <rtems/score/thread.h>
     
    3031    return EINVAL;
    3132
    32   _Thread_Disable_dispatch();
    33 
    3433  if ( !once_control->init_executed ) {
    35     once_control->is_initialized = TRUE;
    36     once_control->init_executed = TRUE;
    37     (*init_routine)();
     34    rtems_mode saveMode;
     35    rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
     36    if ( !once_control->init_executed ) {
     37      once_control->is_initialized = TRUE;
     38      once_control->init_executed = TRUE;
     39      (*init_routine)();
     40    }
     41    rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
    3842  }
    39 
    40   _Thread_Enable_dispatch();
    4143  return 0;
    4244}
  • cpukit/posix/ChangeLog

    r49155d9 rb04ee63  
     12002-03-01      Eric Norum <eric.norum@usask.ca>
     2
     3        * src/pthreadonce.c: Task is not preemptable while running a
     4        pthread_once init function.  This is slightly less heavy handed
     5        than disabling dispatching and seems better than consuming a mutex.
     6
    172002-02-09      Ralf Corsepius <corsepiu@faw.uni-ulm.de>
    28
  • cpukit/posix/src/pthreadonce.c

    r49155d9 rb04ee63  
    1919#include <errno.h>
    2020
     21#include <rtems.h>
    2122#include <rtems/system.h>
    2223#include <rtems/score/thread.h>
     
    3031    return EINVAL;
    3132
    32   _Thread_Disable_dispatch();
    33 
    3433  if ( !once_control->init_executed ) {
    35     once_control->is_initialized = TRUE;
    36     once_control->init_executed = TRUE;
    37     (*init_routine)();
     34    rtems_mode saveMode;
     35    rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode);
     36    if ( !once_control->init_executed ) {
     37      once_control->is_initialized = TRUE;
     38      once_control->init_executed = TRUE;
     39      (*init_routine)();
     40    }
     41    rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode);
    3842  }
    39 
    40   _Thread_Enable_dispatch();
    4143  return 0;
    4244}
Note: See TracChangeset for help on using the changeset viewer.