This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]