Dell Technologies Interview Question

Writing C language to implement read lock and write lock