Ignore:
Timestamp:
Apr 18, 2016, 4:23:27 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
ca18cb59
Parents:
928d455
git-author:
Sebastian Huber <sebastian.huber@…> (04/18/16 04:23:27)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/21/16 05:29:38)
Message:

score: Fix _CORE_semaphore_Flush()

Use proper CORE_semaphore_Status for _CORE_semaphore_Flush() and
_CORE_semaphore_Destroy() operations.

Close #2696.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxsem01/init.c

    r928d455 r90f1265  
    2727
    2828#define MAX_SEMS  10
     29
     30static void *sem_wait_task(void *arg)
     31{
     32  sem_t *sem;
     33  int    rv;
     34
     35  sem = arg;
     36
     37  rv = sem_wait( sem );
     38  rtems_test_assert( rv == 0 );
     39
     40  errno = 0;
     41  rv = sem_wait( sem );
     42  rtems_test_assert( rv == -1 );
     43  rtems_test_assert( errno == EINVAL );
     44
     45  return NULL;
     46}
     47
     48static void test_sem_wait_during_delete(void)
     49{
     50  sem_t     sem;
     51  int       rv;
     52  pthread_t th;
     53  int       eno;
     54  int       val;
     55
     56  rv = sem_init( &sem, 0, 1 );
     57  rtems_test_assert( rv == 0 );
     58
     59  eno = pthread_create( &th, NULL, sem_wait_task, &sem );
     60  rtems_test_assert( eno == 0 );
     61
     62  rv = sem_getvalue( &sem, &val );
     63  rtems_test_assert( rv == 0 );
     64  rtems_test_assert( val == 1 );
     65
     66  sched_yield();
     67
     68  rv = sem_getvalue( &sem, &val );
     69  rtems_test_assert( rv == 0 );
     70  rtems_test_assert( val == 0 );
     71
     72  rv = sem_destroy( &sem );
     73  rtems_test_assert( rv == 0 );
     74
     75  eno = pthread_join( th, NULL );
     76  rtems_test_assert( eno == 0 );
     77}
    2978
    3079void *POSIX_Init(
     
    296345  rtems_test_assert( (status == -1) && (errno == ENOENT) );
    297346
     347  test_sem_wait_during_delete();
    298348
    299349  /* Try adding in unlinking before closing... (can we still open?) */
     
    313363#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
    314364
    315 #define CONFIGURE_MAXIMUM_POSIX_THREADS     1
     365#define CONFIGURE_MAXIMUM_POSIX_THREADS     2
    316366#define CONFIGURE_MAXIMUM_POSIX_SEMAPHORES  MAX_SEMS
    317367
Note: See TracChangeset for help on using the changeset viewer.