NVIDIA Interview Question

Implement a reader-writer locking system.