This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
pthread_rwlock_rdlock()
- From: Cyril Hrubis <chrubis at suse dot cz>
- To: libc-alpha at sources dot redhat dot com
- Cc: "Peter W. Morreale" <pmorreale at novell dot com>
- Date: Thu, 8 Sep 2011 11:50:34 +0200
- Subject: pthread_rwlock_rdlock()
Hi!
We are currently working on fixing the Open Posix Testsuite (which is
part of the LTP). And while doing that we found one test that seems to
be correct but fails every time.
It could be found in LTP git on sf.net in
testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
Basically the test does:
main thread: -> obtain read lock
writer thread: -> attempt to obtain write lock - block
reader tread: -> attempt to obtain read lock - succeeds.
And it expects the reader thread block, since another thread wants a
write lock.
Which seems to be correct assumption accordingly to POSIX. While digging
deeper I've found that such behavior is undefined in Single Unix
Specification.
--
Cyril Hrubis
chrubis@suse.cz