use own rwlock function