diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-08-04 14:42:05 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2011-08-04 14:42:05 +0000 |
commit | b61bb4f44c01cd7866dd89129995c9ede050ff24 (patch) | |
tree | a1fa97bad1797df21d65f52940137ba181ddf647 /testsuites/psxtmtests/psxtmrwlock03 | |
parent | Regenerate. (diff) | |
download | rtems-b61bb4f44c01cd7866dd89129995c9ede050ff24.tar.bz2 |
2011-08-04 Joel Sherrill <joel.sherrill@oarcorp.com>
* psxtmrwlock03/init.c: Fix abstime issue. Time is now reasonable.
Diffstat (limited to '')
-rw-r--r-- | testsuites/psxtmtests/psxtmrwlock03/init.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/testsuites/psxtmtests/psxtmrwlock03/init.c b/testsuites/psxtmtests/psxtmrwlock03/init.c index e6b901f610..b1c5448ff2 100644 --- a/testsuites/psxtmtests/psxtmrwlock03/init.c +++ b/testsuites/psxtmtests/psxtmrwlock03/init.c @@ -22,6 +22,7 @@ #include "test_support.h" pthread_rwlock_t rwlock; +struct timespec abstime; void *Low( void *argument @@ -58,10 +59,6 @@ void *Middle( ) { int status; - struct timespec abstime; - - abstime.tv_sec = 0; - abstime.tv_nsec = 0; /* * Now we have finished the thread startup overhead, @@ -74,9 +71,7 @@ void *Middle( /* this timed read lock operation will be blocked * cause a write operation has the lock */ status = pthread_rwlock_timedrdlock(&rwlock, &abstime); - /*status should be non zero, cause read lock is refused... - * blocked during abstime */ - rtems_test_assert( status == ETIMEDOUT ); + rtems_test_assert( status == 0 ); return NULL; } @@ -100,6 +95,13 @@ void *POSIX_Init( rtems_test_assert( !status ); /* + * Timeout for 5 seconds from now. + */ + status = clock_gettime( CLOCK_REALTIME, &abstime ); + rtems_test_assert( !status ); + abstime.tv_sec += 5; + + /* * Deliberately create the rwlock after the threads. This way if the * threads do run before we intend, they will get an error. */ |