Hello everyone,
I am working on Yocto( a kind of embedded linux) to make POSIX test
cases pass. It uses kernel 3.0 and eglibc 2.3.
There are 3 failed test cases about pthread rwlock:
pthread_rwlock_rdlock/2-1 pthread_rwlock_rdlock/2-2
pthread_rwlock_unlock/3-1
In pthread_rwlock_rdlock/2-1, main thread read lock a
rwlock, child thread1 write lock the rwlock with a medium
priority, so it should be blocked. child thread2 try to read
lock the rwlock with low priority, the case says child
thread2 should block too. But in Yocto linux child thread2 doesn't
block and then read lock the rwlock, that make test case fail.
In eglibc nptl implementation, rwlock has a element "__flags" to
identify prefer write lock or read lock, default is to prefer read
lock. If change __flags to prefer write lock, the test case will
pass.
My questions are:
1 What is the test case base on? I checked the POSIX.1-2008 but
didn't find description priority about the pthread rwlock? Could
anyone give me a source that make me to understand it better?
2 Which C library or platform can make this case pass? So that I can
compare it with eglibc.
Thanks a lot!
Kai