Ignore:
Timestamp:
Jul 24, 2008, 8:43:58 PM (12 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
9b4f75e
Parents:
d17c114
Message:

2008-07-24 Joel Sherrill <joel.sherrill@…>

PR 1291/cpukit

  • psx05/init.c, psxmsgq01/init.c, psxmsgq01/system.h, psxsem01/init.c, psxsem01/psxsem01.scn: Update tests to reflect changes required by problem.
File:
1 edited

Legend:

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

    rd17c114 r1750f5a6  
    7373}
    7474
     75void calculate_abstimeout(
     76  struct timespec *times,
     77  uint32_t         seconds,
     78  uint32_t         nanoseconds
     79)
     80{
     81  struct timeval       tv1;
     82  struct timezone      tz1;
     83
     84  gettimeofday( &tv1, &tz1 );
     85
     86  times->tv_sec  = seconds     + tv1.tv_sec;
     87  times->tv_nsec = nanoseconds + (tv1.tv_usec * 1000);
     88
     89  while ( times->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) {
     90    times->tv_sec++;
     91    times->tv_nsec - TOD_NANOSECONDS_PER_SECOND;
     92  }
     93
     94}
     95
    7596void *POSIX_Init(
    7697  void *argument
     
    344365  assert( status == EPERM );
    345366
    346   times.tv_sec = 0;
    347   times.tv_nsec = 500000000;
    348367  puts( "Init: pthread_mutex_timedlock - time out in 1/2 second" );
     368  calculate_abstimeout( &times, 0, (TOD_NANOSECONDS_PER_SECOND / 2) );
     369
    349370  status = pthread_mutex_timedlock( &Mutex_id, &times );
    350   if ( status != EAGAIN )
    351     printf( "status = %d\n", status );
    352   assert( status == EAGAIN );
     371  if ( status != ETIMEDOUT )
     372    printf( "status = %d\n", status );
     373  assert( status == ETIMEDOUT );
    353374
    354375     /* switch to idle */
Note: See TracChangeset for help on using the changeset viewer.