From: Bian N. <bi...@cn...> - 2011-03-24 03:20:16
|
Specifying a passed abs_timeout to pthread_rwlock_timedwrlock. Signed-off-by: Bian Naimeng <bi...@cn...> --- .../interfaces/pthread_rwlock_timedwrlock/2-1.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c index b837fac..3ce260c 100644 --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_timedwrlock/2-1.c @@ -34,7 +34,6 @@ static pthread_rwlock_t rwlock; static int thread_state; -static int currsec1, currsec2; static int expired; /* thread_state indicates child thread state: @@ -54,7 +53,7 @@ static void* fn(void *arg) thread_state = ENTERED_THREAD; /* Absolute time, not relative. */ - abs_timeout.tv_sec = currsec1 - TIMEOUT; + abs_timeout.tv_sec = time(NULL) - TIMEOUT; abs_timeout.tv_nsec = 0; printf("thread: attempt timed write-lock\n"); @@ -81,8 +80,6 @@ static void* fn(void *arg) exit(PTS_UNRESOLVED); } - /* Get time after the mutex timed out in locking. */ - currsec2 = time(NULL); thread_state = EXITING_THREAD; pthread_exit(0); return NULL; @@ -167,4 +164,4 @@ int main() printf("Test PASSED\n"); return PTS_PASS; -} \ No newline at end of file +} -- 1.7.1 |