Changeset dbd6550 in rtems


Ignore:
Timestamp:
May 27, 2016, 9:10:42 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
bbb3c5f
Parents:
e0bb60b
git-author:
Sebastian Huber <sebastian.huber@…> (05/27/16 09:10:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/30/16 14:16:22)
Message:

posix: Avoid use of internal mutex methods

Avoid use of internal mutex methods for pthread_mutex_setprioceiling().

File:
1 edited

Legend:

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

    re0bb60b rdbd6550  
    3434  register POSIX_Mutex_Control *the_mutex;
    3535  Priority_Control              the_priority;
    36   Thread_queue_Context          queue_context;
     36  int                           error;
    3737
    3838  if ( !old_ceiling )
     
    4848   *  POSIX says block until we acquire it.
    4949   */
    50   (void) pthread_mutex_lock( mutex );
    51 
    52   /*
    53    *  Do not worry about the return code from this.  The Get operation
    54    *  will also fail if it is a bad id or was deleted between the two
    55    *  operations.
    56    *
    57    *  NOTE: This makes it easier to get 100% binary coverage since the
    58    *        bad Id case is handled by the switch.
    59    */
    60   the_mutex = _POSIX_Mutex_Get( mutex, &queue_context );
    61 
    62   if ( the_mutex == NULL ) {
     50  error = pthread_mutex_lock( mutex );
     51  if ( error != 0 ) {
     52    _Assert( error == EINVAL );
    6353    return EINVAL;
    6454  }
     55
     56  the_mutex = _POSIX_Mutex_Get_no_protection( mutex );
     57  _Assert( the_mutex != NULL );
    6558
    6659  *old_ceiling = _POSIX_Priority_From_core(
     
    6962  the_mutex->Mutex.Attributes.priority_ceiling = the_priority;
    7063
    71   /*
    72    *  We are required to unlock the mutex before we return.
    73    */
    74   _CORE_mutex_Surrender(
    75     &the_mutex->Mutex,
    76     &queue_context
    77   );
     64  error = pthread_mutex_unlock( mutex );
     65  _Assert( error == 0 );
     66  (void) error;
    7867  return 0;
    7968}
Note: See TracChangeset for help on using the changeset viewer.