This should be relatively simple, by changing the order of looking at __writerqueue vs __readerqueue in __pthread_rwlock_unlock
Note: there is a series of tests in nptl/tst-rwlock{2,6,7,8,9,10,11,17,18,20,2a,2b}.c, to be moved to sysdeps/pthread/ when the support is ready.