Rfc6810 bis

pull request for reviewing code
Wouldn't pthread_rwlock_rdlock() be sufficient?