move readers-writer lock to rwlock.h