Changeset c030edd in rtems


Ignore:
Timestamp:
Sep 15, 2017, 11:48:44 AM (2 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
f3b29236
Parents:
8230a329
git-author:
Sebastian Huber <sebastian.huber@…> (09/15/17 11:48:44)
git-committer:
Sebastian Huber <sebastian.huber@…> (09/15/17 11:57:53)
Message:

posix: Allow PTHREAD_PROCESS_SHARED for condvar

Close #3137.

Files:
3 edited

Legend:

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

    r8230a329 rc030edd  
    2020
    2121#include <rtems/posix/condimpl.h>
     22#include <rtems/posix/posixapi.h>
    2223
    2324/**
     
    3940   *  Be careful about attributes when global!!!
    4041   */
    41   if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED )
    42     return EINVAL;
    4342
    4443  if ( !the_attr->is_initialized )
    4544    return EINVAL;
     45
     46  if ( !_POSIX_Is_valid_pshared( the_attr->process_shared ) ) {
     47    return EINVAL;
     48  }
    4649
    4750  the_cond = _POSIX_Condition_variables_Allocate();
  • testsuites/psxtests/psx10/init.c

    r8230a329 rc030edd  
    115115  rtems_test_assert( status == EINVAL );
    116116  puts( "Init: pthread_cond_destroy - EINVAL (cond invalid)" );
     117
     118/* pshared tests */
     119
     120  puts( "Init: pthread_cond_init - EINVAL (invalid pshared)" );
     121  attr.process_shared = -1;
     122  status = pthread_cond_init( &cond, &attr );
     123  rtems_test_assert( status == EINVAL );
     124
     125  puts( "Init: pthread_condattr_setpshared - PTHREAD_PROCESS_SHARED" );
     126  status = pthread_condattr_setpshared( &attr, PTHREAD_PROCESS_SHARED );
     127  rtems_test_assert( status == 0 );
     128
     129  puts( "Init: pthread_cond_init - OK" );
     130  status = pthread_cond_init( &cond, &attr );
     131  rtems_test_assert( status == 0 );
     132
     133  puts( "Init: pthread_cond_destroy - OK" );
     134  status = pthread_cond_destroy( &cond );
     135  rtems_test_assert( status == 0 );
    117136
    118137/* initiailize the attribute for the rest of the test */
  • testsuites/psxtests/psx10/psx10.scn

    r8230a329 rc030edd  
    1 *** POSIX TEST 10 ***
     1*** BEGIN OF TEST PSX 10 ***
    22Init: pthread_condattr_init
    33Init: pthread_condattr_init - EINVAL (attribute invalid)
     
    1616Init: pthread_cond_destroy
    1717Init: pthread_cond_destroy - EINVAL (cond invalid)
     18Init: pthread_cond_init - EINVAL (invalid pshared)
     19Init: pthread_condattr_setpshared - PTHREAD_PROCESS_SHARED
     20Init: pthread_cond_init - OK
     21Init: pthread_cond_destroy - OK
    1822Init: pthread_cond_init - attr
     23
    1924Init: sleep to switch to Task_1
    2025Task_1: ID is 0x0b010002
     
    2227Init: pthread_cond_destroy - EBUSY (task1 waiting)
    2328Init: pthread_cond_signal
     29
    2430Init: sleep - switch to Task_1 and Task_2
    2531Task_1: back from pthread_cond_wait release mutex
     
    3541Init: pthread_cond_timedwait for 3 seconds
    3642Init: pthread_cond_timedwait - ETIMEDOUT - (mutex not acquired)
     43
    3744Init: pthread_cond_signal - EINVAL (cond invalid)
    3845Init: pthread_cond_broadcast - EINVAL (cond invalid)
     
    4653Init: pthread_cond_wait - EINVAL (mutex not locked before call)
    4754Init: pthread_cond_timedwait - EINVAL (mutex not locked before call)
     55
    4856Init: sleep - switch to Task_3
    4957Task_3: ID is 0x0b010004
     
    5361Task_3: pthread_cond_wait - EINVAL (mutex not locked after signal)
    5462Task_3: task exit
    55 *** END OF POSIX TEST 10 ***
     63*** END OF TEST PSX 10 ***
Note: See TracChangeset for help on using the changeset viewer.