summaryrefslogtreecommitdiffstats
path: root/testsuites
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-08-04 14:42:05 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-08-04 14:42:05 +0000
commitb61bb4f44c01cd7866dd89129995c9ede050ff24 (patch)
treea1fa97bad1797df21d65f52940137ba181ddf647 /testsuites
parentRegenerate. (diff)
downloadrtems-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 'testsuites')
-rw-r--r--testsuites/psxtmtests/ChangeLog4
-rw-r--r--testsuites/psxtmtests/psxtmrwlock03/init.c16
2 files changed, 13 insertions, 7 deletions
diff --git a/testsuites/psxtmtests/ChangeLog b/testsuites/psxtmtests/ChangeLog
index f275700ad0..8808d55851 100644
--- a/testsuites/psxtmtests/ChangeLog
+++ b/testsuites/psxtmtests/ChangeLog
@@ -1,3 +1,7 @@
+2011-08-04 Joel Sherrill <joel.sherrill@oarcorp.com>
+
+ * psxtmrwlock03/init.c: Fix abstime issue. Time is now reasonable.
+
2011-08-02 Ricardo Aguirre <el.mastin@ymail.com>
PR 1880/tests
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.
*/