reader-writer lock with condition
sempahore