pthread_rwlock_rdlock()
Cyril Hrubis
chrubis@suse.cz
Thu Oct 13 10:30:00 GMT 2011
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.
Anybody any comments on this?
I'm perfectly fine if anybody proves me wrong ;).
Or if it turns out this is not supported on Linux.
Or with any other reasonable resolution.
--
Cyril Hrubis
chrubis@suse.cz
More information about the Libc-alpha
mailing list