Changeset 62c912e in rtems


Ignore:
Timestamp:
Sep 8, 2017, 11:10:24 AM (23 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
1bc0ad2
Parents:
4e0ba7e
git-author:
Sebastian Huber <sebastian.huber@…> (09/08/17 11:10:24)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/12/17 06:11:08)
Message:

posix: Use mutex object itself for condvar

We should only use the address used to initialize the mutex object
according to POSIX, "2.9.9 Synchronization Object Copies and Alternative
Mappings".

http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_09

Update #3113.

Location:
cpukit/posix
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/include/rtems/posix/cond.h

    r4e0ba7e r62c912e  
    4444   Objects_Control       Object;
    4545   Thread_queue_Control  Wait_queue;
    46    pthread_mutex_t       mutex;
     46   pthread_mutex_t      *mutex;
    4747   clockid_t             clock;
    4848}  POSIX_Condition_variables_Control;
  • cpukit/posix/include/rtems/posix/condimpl.h

    r4e0ba7e r62c912e  
    3232 *  a mutex assigned to it.
    3333 */
    34 #define POSIX_CONDITION_VARIABLES_NO_MUTEX 0
     34#define POSIX_CONDITION_VARIABLES_NO_MUTEX NULL
    3535
    3636#define POSIX_CONDITION_VARIABLES_TQ_OPERATIONS &_Thread_queue_Operations_FIFO
  • cpukit/posix/src/condwaitsupp.c

    r4e0ba7e r62c912e  
    3939  the_cond = POSIX_CONDITION_VARIABLE_OF_THREAD_QUEUE_QUEUE( queue );
    4040
    41   mutex_error = pthread_mutex_unlock( &the_cond->mutex );
     41  mutex_error = pthread_mutex_unlock( the_cond->mutex );
    4242  if ( mutex_error != 0 ) {
    4343    /*
     
    108108  if (
    109109    the_cond->mutex != POSIX_CONDITION_VARIABLES_NO_MUTEX
    110       && the_cond->mutex != *mutex
     110      && the_cond->mutex != mutex
    111111  ) {
    112112    _POSIX_Condition_variables_Release( the_cond, &queue_context );
     
    114114  }
    115115
    116   the_cond->mutex = *mutex;
     116  the_cond->mutex = mutex;
    117117  executing = _Thread_Executing;
    118118
     
    136136    _POSIX_Condition_variables_Release( the_cond, &queue_context );
    137137
    138     mutex_error = pthread_mutex_unlock( &the_cond->mutex );
     138    mutex_error = pthread_mutex_unlock( the_cond->mutex );
    139139    if ( mutex_error != 0 ) {
    140140      error = EPERM;
Note: See TracChangeset for help on using the changeset viewer.