Changeset 94ccbb7 in rtems


Ignore:
Timestamp:
Jun 30, 2009, 5:50:15 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
d852e234
Parents:
b4e5a619
Message:

2009-06-30 Joel Sherrill <joel.sherrill@…>

  • psxrwlock01/psxrwlock01.scn, psxrwlock01/test.c: Add test case for obtaining rwlock for read with a timed lock operation when the abstime timeout is in the past.
Location:
testsuites/psxtests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/ChangeLog

    rb4e5a619 r94ccbb7  
     12009-06-30      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * psxrwlock01/psxrwlock01.scn, psxrwlock01/test.c: Add test case for
     4        obtaining rwlock for read with a timed lock operation when the
     5        abstime timeout is in the past.
     6
    172009-06-29      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • testsuites/psxtests/psxrwlock01/psxrwlock01.scn

    rb4e5a619 r94ccbb7  
    7474pthread_rwlock_timedwrlock( &RWLock, &abstime) -- OK
    7575WriteThread - pthread_rwlock_unlock(RWLock) -- OK
    76 pthread_rwlock_timedrdlock( &RWLock, &abstime) -- OK
     76pthread_rwlock_timedrdlock( &RWLock, &abstime) -- ETIMEDOUT
     77pthread_rwlock_timedrdlock( &RWLock, &abstime) -- ETIMEDOUT
     78pthread_rwlock_timedrdlock( &RWLock, &abstime) -- in past -- OK
    7779pthread_rwlock_destroy( &RWLock ) -- OK
    7880*** END OF POSIX RWLOCK TEST 01 ***
  • testsuites/psxtests/psxrwlock01/test.c

    rb4e5a619 r94ccbb7  
    329329  assert( status == EBUSY );
    330330
     331  /* now unlock it so the threads can continue */
    331332  puts( "pthread_rwlock_unlock(RWLock) -- OK" );
    332333  status = pthread_rwlock_unlock(&RWLock);
     
    370371
    371372  abstime.tv_sec += 1;
    372   puts( "pthread_rwlock_timedrdlock( &RWLock, &abstime) -- OK" );
     373  puts( "pthread_rwlock_timedrdlock( &RWLock, &abstime) -- ETIMEDOUT" );
    373374  status = pthread_rwlock_timedrdlock( &RWLock, &abstime );
    374375  assert( status == ETIMEDOUT );
     376
     377  abstime.tv_sec -= 1;
     378  puts( "pthread_rwlock_timedrdlock( &RWLock, &abstime) -- ETIMEDOUT" );
     379  status = pthread_rwlock_timedrdlock( &RWLock, &abstime );
     380  assert( status == ETIMEDOUT );
     381
     382  /*************** OBTAIN RWLOCK WITH ABSTIME IN PAST ***************/
     383  status = pthread_rwlock_unlock(&RWLock);
     384  assert( !status );
     385
     386  abstime.tv_sec -= 1;
     387  puts( "pthread_rwlock_timedrdlock( &RWLock, &abstime) -- in past -- OK" );
     388  status = pthread_rwlock_timedrdlock( &RWLock, &abstime );
     389  assert( status == 0 );
    375390
    376391  /*************** DESTROY RWLOCK ***************/
Note: See TracChangeset for help on using the changeset viewer.