implementing select between rwlock, mutex and spinlock